Featured post
algorithm - 2-3 trees, data storage -
hello i'm trying understand how 2-3 trees work, understood concept keys, store data itself, in leaves, or in nodes 1 key (internal node), , 2 keys (internal node) also, in advance
i'm no expert on tree structure first sentence wikipedia page on 2-3 trees seems answer question data stored:
a 2-3 tree in computer science type of data structure, tree every node children (internal node) has either 2 children , 1 data element (2-nodes) or 3 children , 2 data elements (3-nodes).
seems me store data in each node of tree. wiki page has link java applet demonstrating inserts.
edit: after reading comment, , having sample code, i'm inclined think data , key (as calling it) same thing (as chowlett has mentioned in answer).
looking @ sample code (they storing ints) create twothreenode class holds pointers data storing, ensuring data class has overloaded comparison operators allow them sorted. follow algorithm before.
i found interesting article, source code, here: balanced trees, part 2: interior 2-3 trees
- Get link
- X
- Other Apps
Comments
Post a Comment