Implement a BST class (no balancing) storing unique integer keys:
insert(key) (ignore duplicates), contains(key)delete(key): handle a leaf, a node with one child, and a node with two children (replace it with its in-order successor); no error if missinginorder(): keys in sorted orderheight(): number of nodes on the longest root-to-leaf path (0 for empty)Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial