Trees

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

Resources

Concepts explained here are following those from Neetcode’s roadmap

.


Written By

GitHub Contributor Team