Day11 Path Sum II

LeetCode 113.  Path Sum II Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. 意思是找出從根結點到某葉結點的和等於sum,並記錄這些路徑在數組裏。 我的思路是,利用棧來深度優先遍歷二叉樹,將這個遍歷路徑記錄在一個數組t
相關文章
相關標籤/搜索