Tag: dfs
3 รายการ
Blog
leetcodepythongraphs
LeetCode #133 Clone Graph: คัดลอกวงจรด้วยตาราง old-to-new
เทียบ DFS และ BFS สำหรับ clone กราฟ พร้อม edge cases, decision table และ tests ตรวจ deep copy
leetcodepythontrees
LeetCode #104 Maximum Depth: Recursive DFS, stack หรือ BFS เลือกจากรูปทรงต้นไม้
เทียบสามวิธีหาความลึกสูงสุดของ binary tree พร้อม memory tradeoff, skewed tree และ unittest ที่รันจริง

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