Search code examples
c#data-structurestreeb-tree

How are B Tree nodes typically represented?


I've been doing some brushing up on my B-Tree and 2-3-4 tree (B tree with order 4), and I'm attempting to implement this in C#. My question to you is, given that a B-Tree node can contains N-1 number of items and N subtrees, what is the typical representation for one of these nodes? Is it an array, series of linked-lists, or something I've not considered?


Solution

  • For a 2-3-4 tree, it does not really matter. For large orders, you'd use a sorted array and binary search. For variable-size keys like Strings, a trie might be a good idea.