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

leetcodealgorithmsbinary-tree
LeetCode #226 Invert Binary Tree: สลับลูกซ้าย-ขวาแบบ recursive / BFS
เทียบสี่แนวทางพลิกต้นไม้ทวิภาค พร้อมความซับซ้อนและ unittest

leetcodealgorithmsdynamic-programming
LeetCode #322 Coin Change: แลกเหรียญให้น้อยสุดด้วย DP
เทียบ greedy, BFS ตามจำนวนเหรียญ และ bottom-up DP พร้อมเคสแลกไม่ได้และเหรียญซ้ำค่า