LeetCode: 145 Binary Tree Postorder Traversal
0145 Binary Tree Postorder TraversalProblem DescriptionGiven the root of a binary tree, return the postorder traversal of its nodes' values.ExampleInput: root = [1,null,2,3] Output: [3,2,1]SolutionPle
0145 Binary Tree Postorder TraversalProblem DescriptionGiven the root of a binary tree, return the postorder traversal of its nodes' values.ExampleInput: root = [1,null,2,3] Output: [3,2,1]SolutionPle
Problem DescriptionTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Example 1Input: [1,3,null,null,2] 1 / 3 \ 2 Output: [3,1,null
Problem DescriptionGiven n, how many structurally unique BST's (binary search trees) that store values 1 ... n?ExampleInput: 3 Output: 5 Explanation: Given n = 3, there are a total of 5 unique BST's:
IntroductionIn computer science, a binary search tree (BST), also called an ordered or sorted binary tree, is a rooted binary tree whose internal nodes each store a key greater than all the keys in th