15、课程:树(下).7、练习—Iterative Get和Iterative Add 2 -- 12:36 App 15、课程:树(下).13、练习—Construct Binary Tree from Preorder and Inorder Traversal 1 -- 9:07 App 15、课程:树(下).3、练习—Floor and Ceiling 11 -- 12:45 App 13、课程:哈希表(下).10、作业讲解 3 -- 6...
https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/discuss/252754/Java-Stack-Iterative-Solution https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/discuss/252232/JavaC%2B%2BPython-O(N)-Solution LeetCode All in One 题目讲解汇总(持续更...
https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/discuss/214216/JavaC%2B%2BPython-DFS-Solution https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/discuss/214384/JavaC%2B%2BPython-Iterative-Solution-Using-Stack LeetCode All in One 题目讲解汇总(...
144. Binary Tree Preorder Traversal 这个系列有preorder inorder postorder三题,考点都不是递归,而是迭代。迭代挺难想的,尤其是外面的while循环。这题的迭代写法我模仿inorder写出来了,一步步在纸上模拟入栈出栈就好了。 RECURSION: ITERATION: 看了下discussion,很多跟我写的都不一样,说明迭代写法确实比递归...