File tree Expand file tree Collapse file tree 1 file changed +0
-9
lines changed
aa_data_structures_workshop Expand file tree Collapse file tree 1 file changed +0
-9
lines changed Original file line number Diff line number Diff line change 3737// WRAPPING UP
3838// - Our implementation of a BST doesn't guarantee it to be balanced after any arbitrary insertions.
3939//
40- // - How to delete any node from BST? It's pretty involved:
41- // - find the the node
42- // - keep swapping that node with it's greater child until it is a leaf (at the bottom of the tree)
43- // - swapping with the greater child always guarantees search tree property is not broken
44- // - chop off the leaf, by setting it's parent's reference to null
45- //
4640// - Tree Height Interpretations
4741// - Alvin consider's an empty binary tree as having height 0,
4842// so a tree with a single node has height 1.
5852//
5953// - Then re-reimplement it without recursion.
6054// - which one do you prefer recursive or iterative?
61- //
62- // - Implement #delete(val) using the previously mentioned steps
63- //
6455// Thanks for Attending! -AZ
6556
6657class Node {
You can’t perform that action at this time.
0 commit comments