What are Trees?
- Trees are a type of data structure, where each node has two children each (a left and a right node)
- BST Insert and Remove
- BST (Binary Search Tree) is a special type of binary tree where the value of each node is >= to the value of its left subtree and <= the value of its right subtree
- This structure makes it efficient to perform operations like insert and remove
- Depth-First Search
- Its a graph traversal algorithm that explores all nodes in one branch before moving on to other branches
- Breath-First Search
- Its a graph traversal algorithm that explores all nodes in one depth before moving on to other branches
- BST Sets and Maps
- Sets and maps implemented using BST allows for efficient checking and performing operations
- Iterative DFS
- Better than using recurssion for performance gains
Related examples
- Read my solution to some LeetCode problems below
- Invert Binary Tree
- Kth Smallest Element in a BST
- https://docs.google.com/document/d/1OiEYxC6jXoZMtXaA2dt_krmBJ3YsWWykUzuC_4D4DXg/edit?usp=sharing
Resources
Concepts explained here are following those from Neetcode’s roadmap
.