Yosgi
Yosgi
Avatar
😀
28 results for Binary Tree
  • Time: 30 minutes Serialization is simple and can be solved using BFS Deserialization requires the use of the properties of a binary tree, that is, the child nodes of the i-th node are (i + 1) * 2 - 1 …
    Algorithms Created Thu, 04 Mar 2021 00:00:00 +1300
  • Time: 25 minutes In fact, this is a relatively common DFS type question. The reason why it took so long is because there was a problem in judging the boundary value. When starting from the root, since …
    Algorithms Created Mon, 01 Mar 2021 00:00:00 +1300
  • Techniques and examples for breadth-first (level-order) traversal of binary trees.
    Algorithms Created Sun, 28 Feb 2021 00:00:00 +1300
  • When traversing a binary tree in front, middle, or post-order, we use a stack to simplify operations. This is because they are all recursive structures of DFS, which means processing from bottom to …
    Algorithms Created Sun, 28 Feb 2021 00:00:00 +1300
  • 1h The order of in-order traversal is left - right - center recursion It’s very easy with recursion var postorderTraversal = function(root) { var res = [] if (!root) return res var travel = function …
    Algorithms Created Fri, 26 Feb 2021 00:00:00 +1300
  • 10min The order of pre-order traversal of a binary tree is center-left-right First traverse all root nodes and left nodes, then process the right node It can be seen that this is a recursive behavior. …
    Algorithms Created Thu, 25 Feb 2021 00:00:00 +1300
  • 30min The order of in-order traversal is left - middle - right recursion It’s very easy with recursion var inorderTraversal = function(root) { var res = [] if (!root) { return res } var travel = …
    Algorithms Created Thu, 25 Feb 2021 00:00:00 +1300
  • Time: 40 minutes ####105. Construct a binary tree from pre-order and in-order traversal sequences recursion Pre-order traversal: center-left-right In-order traversal: left-middle-right Therefore, we …
    Algorithms Created Wed, 27 Jan 2021 00:00:00 +1300