Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.github.saligrama:patricia

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.github.saligrama:patricia

A bit-alphabet based, space-optimized trie for string storage

  • 1.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

patricia

Patricia is a bit-alphabet based, space-optimized trie for string storage.

Patricia Trees (also known as Crit-Bit Trees and Compressed Binary Trees) are extremely space-efficient compared to standard tries due to their compression of nodes with only one child. Therefore, no unnecessary nodes and edges are stored, cutting down on both storage and steps needed to traverse the trie.

This trie operates on a bit alphabet and can store any type of ASCII text. It operates similarly to a Radix Tree, with radix r=2.

Usage

Dependency

Add the library as a dependency to your project using Maven.

<dependency>
  <groupId>io.github.saligrama</groupId>
  <artifactId>patricia</artifactId>
  <version>1.0</version>
</dependency>

Example

import io.github.saligrama.patricia.PatriciaTree;

public class PatriciaExample {
    public static void main(String[] args) {
        PatriciaTree tree = new PatriciaTree();
        System.out.println(tree.add("Foo bar baz quux")); // should print true
        System.out.println(tree.contains("Foo")); // should print false
        System.out.println(tree.contains("Foo bar baz quux")); // should print true
        System.out.println(tree.remove("Foo bar baz quux")); // should print true
    }
}

FAQs

Package last updated on 31 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc