Category Archives: Summary

Algorithm Practice Notes

BST
Basis:

symbol table API  (Implement: recursion or non-recursion)

  1. get() / search() — no change to the tree
  2. put() / insert() — change the val of a node OR new node add to the tree, need to return a node  [note: any new node could 1> update a existing node(no change if val the same) 2> add to the leaf  never add to the middle
  3. min() & max()
  4. floor() & ceiling()
  5. select() & rank()  — use size
  6. deleteMin() & deleteMax() & delete()
  7. range searching — based on value + inorder traversal idea
Categories:
  1.  Variants of symbol table API.

 

Hash Table
  1. 387. First Unique Character in a String