Questions tagged [radix-tree]

A radix tree is a trie where each node with only one child is merged with its child as form of space optimization.

44 questions
2
votes
1 answer

How to destroy one radix tree in linux kernel

I'm trying to use radix tree to maintain one internal data for the driver. So what's the proper way to destroy the whole tree? One thought is to traverse the tree with the method mentioned at: 1 For each node, free the item and delete its key from…
Eric
  • 471
  • 4
  • 9
2
votes
2 answers

Patricia Trie for fast retrieval of IPv4 address and satellite data

I am writing a program in C++ that requires IP addresses( all IPv4) to be looked up and stored in a fast way. Every IP address has a data associated with it. In case it already exists in the trie, I intend to merge the data of the IP address in the…
hytriutucx
  • 1,614
  • 6
  • 26
  • 37
1
vote
0 answers

Is this Patricia tree implementation wrong?

I'm reading the chapter Radix Search of the book Algorithms (Robert Sedgwick). I've made a simple implementation and something isn't behaving as expected. In program 15.5 you can see that we start with an empty tree where the head is a null node. In…
1
vote
1 answer

NodeJS: Creating a tree from a string for http routing

I am trying to create a tree like radix tree for http routing My code: interface Node { nodes?: Record methods?: Record unknown> } class Tree { root: Node constructor() { this.root = {} } insert(path:…
iAxel
  • 65
  • 1
  • 8
1
vote
0 answers

Difference between a patricia trie (radix tree with r = 2) and a binary trie?

I am trying to consolidate my understanding of the difference between a patricia trie (radix tree with r = 2) and a binary trie. As far as I can see the implementation of a binary trie and a patricia trie (radix tree with r = 2) are identical? Just…
1
vote
0 answers

In a relaxed radix balanced (RRB) tree, how is the height determined in practice?

In a traditional radix-balanced tree, the height of the tree can be determined quickly by counting the leading zeros of the number of elements of the tree, and indexes to children can be determined by taking successive chunks of bits from the…
1
vote
1 answer

Searching strings in an adaptive radix tree

I have been going through the research paper of "The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases", I had a query on how would you be able to match Strings, with the keys of the node. For example: If I had a word: Iota, which was…
Hoshang Charania
  • 65
  • 1
  • 2
  • 6
1
vote
0 answers

Trie vs Radix tree vs Patricia trie

As I understand (also from here) memory-complexity of these DSs can be ordered like Trie > Radix > Patricia. But what about time-complexity? I assume they are almost same. If to mention my problem, I want to do a lot of prefix search queries from…
1
vote
3 answers

Words with at least 2 common letters

A string is named 2-consistent if each word has at least 2 letters in common with the next word. For example "Atom another era" [atom has a and t in common with another and another has e and a in common with era (the answer is not…
kitz
  • 879
  • 2
  • 9
  • 24
1
vote
1 answer

Issue with infinite loop in radix tree implementation

I'm having trouble with my radix tree implementation. The idea is that I create the first node, then enter a number of binary numbers. The binary numbers determine whether a left node (0) or a right node (1) is created. Once I reach the end of the…
enenra
  • 111
  • 1
  • 11
1
vote
1 answer

dereferencing pointer to incomplete type (radix tree)

I'm having major trouble with my struct definition. I have tried a couple different ways of defining them but can't seem to get rid of the error. I probably also have a wealth of other problems with the code but I can't actually fix those without…
enenra
  • 111
  • 1
  • 11
1
vote
1 answer

How does one build a Radix Tree in JavaScript?

Inspired by iOS7 iMessage's next-word-prediction, I've decided to try to write a script that will learn, based on user input, which words / letters are most likely wanted to complete the user's current word or which word might most likely be desired…
user2076675
1
vote
0 answers

I want to add my variable in linux page cache

I want to add my variable in linux page cache. Page cache is managed by radix tree. struct radix_tree_node { unsigned long X[RADIX_TREE_MAP_SIZE]; } I want to add my variable 'X' in radix-tree-node. But, it doesn't work when fill 'X' of…
user314817
  • 11
  • 1
1
vote
0 answers

How to find if a child node of a binary radix tree is an internal node or leaf node?

I am creating a binary radix tree(longest common prefix tree). The data is stored only in leaf nodes. The tree hierarchy has internal nodes and each internal node has two child nodes. A child node can either be a leaf node or internal node. Both…
nurabha
  • 1,152
  • 3
  • 18
  • 42
0
votes
1 answer

does `radix_tree_insert` need `spin_lock` to protect it

radix_tree_insert is protected by spin_lock in Linux kernel source code. But the dmesg shows warning information as below: [ 667.551326] dump_backtrace.cfi_jt+0x0/0x8 [ 667.556266] show_stack+0x1c/0x2c [ 667.560415] dump_stack_lvl+0x94/0x100 [ …
user1651758
  • 145
  • 12