Tag: binary-tree
4 รายการ
Blog
leetcodepythonbinary-tree
LeetCode 105: สร้าง Binary Tree จาก Preorder กับ Inorder
เทียบ recursive hash map, iterative stack และ naive scan พร้อม complexity, decision table และ Python tests

leetcodealgorithmsbinary-tree
LeetCode #543 Diameter of Binary Tree: เส้นทางยาวสุดผ่านโหนดใดก็ได้
อธิบายเส้นผ่านศูนย์กลางของต้นไม้ทวิภาคด้วย DFS เก็บ best พร้อมแนวอื่นและ unittest

leetcodealgorithmsbinary-tree
LeetCode #226 Invert Binary Tree: สลับลูกซ้าย-ขวาแบบ recursive / BFS
เทียบสี่แนวทางพลิกต้นไม้ทวิภาค พร้อมความซับซ้อนและ unittest
leetcodealgorithmspython
LeetCode 98: ตรวจ BST ด้วย Bound หรือ Inorder แบบไหนชัดกว่า
เทียบ recursive bounds, iterative inorder และเก็บลำดับก่อนตรวจ พร้อม complexity, decision table และ test กรณี node ผิดข้าม subtree