Category : Interview

Introduction to Binary Tree Basic structure: function TreeNode(x) { this.val = x; this.left = null; this.right = null; } Definition of traversal of binary tree’s pre-order, mid-order and post-order; Preorder traversal: for any subtree, first access heel, then traverse its left subtree, and finally traverse its right subtree; Mid-order traversal: for any subtree, first traverse ..

Read more

subject Title descriptionEveryone knows the Fibonacci sequence. Now you are required to enter an integer n. Please output the n-th term of the Fibonacci sequence (starting from 0, the 0-th term is 0). Basic idea This problem is actually treated as a counterexample of recursion in the sword-like offer. The essence of recursion is that ..

Read more