Record lookup( x ) { n = root node; // Start at the root /* ======================================== Traverse internal nodes to reach a leaf ======================================== */ while ( n ≠ leaf node ) { n is indexed using component i; if ( x.comp_{i} < n.key ) n = n.left; else n = n.right; } /* ============================ We have reached a leaf node ============================ */ if ( x is found in n (leaf node) ) { return Record for x } else { return No Found; } } 
Example: lookup age = 35 and salary = 500K
insert ( Record x ) { Use the search key in x to find: the leaf node L that will hold x if ( L has space store store x ) { insert record x in (block) L; } else { /* ========================================= Split the leaf node L ========================================= */ Choose a component key value K that: divides L into 2 (equal) halves: L1 and L2; Move all records with key < K into L1; Move all records with key >= K into L2; Replace L by an internal node with key K; Set: K,left = L1; K.right = L2; } } 

