Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/amit-davidson/btree
/ functions
Functions
50 in github.com/amit-davidson/btree
⨍
Functions
50
◇
Types & classes
3
↓ 180 callers
Function
NewEmptyNode
()
btree.go:159
↓ 179 callers
Method
addItems
(keys ...string)
btree_test.go:61
↓ 148 callers
Method
addChildNode
(child *Node)
btree_test.go:14
↓ 31 callers
Function
newTreeWithRoot
(root *Node, minItems int)
btree.go:29
↓ 19 callers
Function
areTreesEqual
(t *testing.T, t1, t2 *Tree)
btree_test.go:20
↓ 14 callers
Method
Remove
Remove removes a key from the tree. It finds the correct node and the index to remove the item from and removes it. When performing the search, the an
btree.go:78
↓ 8 callers
Method
Put
Put adds a key to the tree. It finds the correct node and the insertion index and adds the item. When performing the search, the ancestors are returne
btree.go:47
↓ 8 callers
Method
isLeaf
()
btree.go:182
↓ 6 callers
Method
Find
Find Returns an item according based on the given key by performing a binary search.
btree.go:105
↓ 6 callers
Function
NewTree
(minItems int)
btree.go:39
↓ 4 callers
Function
newItem
(key string, value interface{})
btree.go:22
↓ 3 callers
Function
NewNode
(bucket *Tree, value []*Item, childNodes []*Node)
btree.go:166
↓ 3 callers
Method
findKey
findKey finds the node with the key, it's index in the parent's items and a list of its ancestors (not including the node itself). The parent's items
btree.go:118
↓ 3 callers
Method
isOverPopulated
()
btree.go:186
↓ 2 callers
Method
addItem
addItem adds an item at a given position. If the item is in the end, then the list is appended. Otherwise, the list is shifted and the item is inserte
btree.go:211
↓ 2 callers
Function
createTestMockTree
()
btree_test.go:42
↓ 2 callers
Method
getNodes
getNodes returns a list of nodes based on their indexes (the breadcrumbs) from the root p \ a b \ / \ c d e f For [0,1,0] -
btree.go:149
↓ 2 callers
Method
split
split rebalances the tree after adding. After insertion the modified node has to be checked to make sure it didn't exceed the maximum number of elemen
btree.go:242
↓ 1 callers
Function
areNodesEqual
(t *testing.T, n1, n2 *Node)
btree_test.go:24
↓ 1 callers
Function
areTreesEqualHelper
(t *testing.T, n1, n2 *Node)
btree_test.go:31
↓ 1 callers
Function
isFirst
(index int)
btree.go:178
↓ 1 callers
Function
isLast
(index int, parentNode *Node)
btree.go:174
↓ 1 callers
Method
isUnderPopulated
()
btree.go:190
↓ 1 callers
Function
merge
(pNode *Node, unbalancedNodeIndex int)
btree.go:390
↓ 1 callers
Method
rebalanceRemove
rebalanceRemove rebalances the tree after a remove operation. This can be either by rotating to the right, to the left or by merging. Firstly, the sib
btree.go:275
↓ 1 callers
Method
removeItemFromInternal
(index int)
btree.go:306
↓ 1 callers
Method
removeItemFromLeaf
(index int)
btree.go:302
↓ 1 callers
Function
rotateLeft
(aNode, pNode, bNode *Node, bNodeIndex int)
btree.go:360
↓ 1 callers
Function
rotateRight
(aNode, pNode, bNode *Node, bNodeIndex int)
btree.go:330
Function
Test_BucketAddAndRebalanceSplit
(t *testing.T)
btree_test.go:108
Function
Test_BucketAddMultiple
(t *testing.T)
btree_test.go:96
Function
Test_BucketAddSingle
(t *testing.T)
btree_test.go:68
Function
Test_BucketFindNode
(t *testing.T)
btree_test.go:757
Function
Test_BucketRemoveFromInnerNodeAndRotateLeft
(t *testing.T)
btree_test.go:375
Function
Test_BucketRemoveFromInnerNodeAndRotateRight
(t *testing.T)
btree_test.go:444
Function
Test_BucketRemoveFromInnerNodeAndUnion
(t *testing.T)
btree_test.go:513
Function
Test_BucketRemoveFromLeafAndRotateLeft
(t *testing.T)
btree_test.go:569
Function
Test_BucketRemoveFromLeafAndRotateRight
(t *testing.T)
btree_test.go:635
Function
Test_BucketRemoveFromLeafAndUnion
(t *testing.T)
btree_test.go:701
Function
Test_BucketRemoveFromRootAndRebalanceMergeFromUnbalanced
Test_BucketRemoveFromRootAndRebalanceMergeFromUnbalanced tests when the unbalanced node is not the most left one so the merge has to happen from the u
btree_test.go:340
Function
Test_BucketRemoveFromRootAndRebalanceMergeToUnbalanced
Test_BucketRemoveFromRootAndRebalanceMergeToUnbalanced tests when the unbalanced node is the most left one so the merge has to happen from the right n
btree_test.go:304
Function
Test_BucketRemoveFromRootAndRotateLeft
(t *testing.T)
btree_test.go:226
Function
Test_BucketRemoveFromRootAndRotateRight
(t *testing.T)
btree_test.go:264
Function
Test_BucketRemoveFromRootSingleElement
(t *testing.T)
btree_test.go:79
Function
Test_BucketRemoveFromRootWithoutRebalance
(t *testing.T)
btree_test.go:195
Function
Test_BucketSplitAndMerge
(t *testing.T)
btree_test.go:143
Function
Test_BucketUpdateNode
(t *testing.T)
btree_test.go:799
Method
addChild
addChild adds a child at a given position. If the child is in the end, then the list is appended. Otherwise, the list is shifted and the child is inse
btree.go:224
Method
findKey
findKey iterates all the items and finds the key. If the key is found, then the item is returned. If the key isn't found then it means we have to keep
btree.go:196
Function
main
()
main.go:5