Data Structures/B* Tree
treebalancedmultiway
Press play to start
1int bstar_search(BNode* node, int val) {
2 int i = 0;
3 while (i < node->n && val > node->keys[i]) i++;
4 if (i < node->n && node->keys[i] == val) return 1;
5 if (node->is_leaf) return 0;
6 return bstar_search(node->children[i], val);
7}
Step 1/0

Practice

LeetCode·#700 Search in a BSTEasy
OperationBestAverageWorst
searchO(log n)O(log n)O(log n)
insertO(log n)O(log n)O(log n)
SpaceO(n)