Another contribution from my good friend EvilSay, the following is the original text: 1. Basic Definition Each child node of the binary search tree has at most two leaf nodes. Each node of the binary search tree has at most one root node. Stored elements must be comparable The value of each child node of ..

#### Category : Binary tree

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 ..

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 ..