Pohon Biner

Jelajahi pohon biner, aturan BST, dan konstruksi struktur.

07 Pohon Biner

Jelajahi pohon biner, aturan BST, dan konstruksi struktur.

Prasyarat: Linked List

  1. Invert Binary Tree di LeetCode (easy)
  2. Maximum Depth of Binary Tree di LeetCode (easy)
  3. Diameter of Binary Tree di LeetCode (easy)
  4. Balanced Binary Tree di LeetCode (easy)
  5. Same Tree di LeetCode (easy)
  6. Subtree of Another Tree di LeetCode (easy)
  7. Lowest Common Ancestor of a Binary Search Tree di LeetCode (medium)
  8. Binary Tree Level Order Traversal di LeetCode (medium)
  9. Binary Tree Right Side View di LeetCode (medium)
  10. Count Good Nodes in Binary Tree di LeetCode (medium)
  11. Validate Binary Search Tree di LeetCode (medium)
  12. Kth Smallest Element in a BST di LeetCode (medium)
  13. Construct Binary Tree from Preorder and Inorder Traversal di LeetCode (medium)
  14. Binary Tree Maximum Path Sum di LeetCode (hard)
  15. Serialize and Deserialize Binary Tree di LeetCode (hard)

Materi

  1. Traversal pohon dan state per node: Pakai DFS dan BFS pada pohon, hitung tinggi serta level, dan tentukan state yang turun atau naik di tiap node.
  2. Invariant pohon pencarian biner: Validasi BST dengan batas semua leluhur, gunakan inorder untuk urutan nilai, dan cari titik pisah dua target.
  3. Konstruksi dan serialisasi pohon: Bangun pohon dari dua urutan traversal, simpan bentuk dengan penanda kosong, dan ringkas jalur maksimum.

Topik terkait

Topik berikutnya

Trie

Catat progress di workspace Roadmap Algoritma