Coder Social home page Coder Social logo

oroszgy / radixtree Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 3.0 340 KB

Fork of the project http://code.google.com/p/radixtree

Home Page: http://code.google.com/p/radixtree

Java 37.31% JavaScript 62.69%
java data-structures radix-tree radix-trie suffix-tree javascript

radixtree's Introduction

A radix tree, Patricia trie/tree, or crit bit tree is a specialized set data structure based on the trie that is used to store a set of strings. In contrast with a regular trie, the edges of a Patricia trie are labelled with sequences of characters rather than with single characters. These can be strings of characters, bit strings such as integers or IP addresses, or generally arbitrary sequences of objects in lexicographical order. Sometimes the names radix tree and crit bit tree are only applied to trees storing integers and Patricia trie is retained for more general inputs, but the structure works the same way in all cases.

For more information see http://en.wikipedia.org/wiki/Radix_tree

I have created this Radix tree for a project that required fast searching of user name prefixes for a Google AJAX Search like interface. (tahseen.ur.rehman)

Radix Tree gives fastest possible ways to search prefixes. For example it can quickly answer queries like "Find all user name starting with 'tahseen'"

The database solution for this problem boils down to queries like select * from user where username like 'tahseen%'

Database solution does not scale very well if you have a large number of concurrent users searching.

A memory based Radix Tree scales very well.

--
This implementation of the Radix tree is also capable of finding those values in the tree, which belangs to a key sequence in the tree what are prefixes of a given value.

radixtree's People

Contributors

oroszgy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

radixtree's Issues

Cannot retrieve a value which has an empty String key.

t.insert("", "sg");
System.out.println(t.contains("")); // prints false

The problem is that, the when you try to find the key "", the root node will match, which is a non real node. (In this tree, you cannot store multiple values for a single key.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.