Documentation
¶
Overview ¶
https://leetcode.com/problems/increasing-order-search-tree/
Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, \ and every node has no left child and only 1 right child.
Example 1: Input: [5,3,6,2,4,null,8,1,null,null,null,7,9]
5 / \ 3 6 / \ \ 2 4 8 / / \
1 7 9
Output: [1,null,2,null,3,null,4,null,5,null,6,null,7,null,8,null,9]
1 \ 2 \ 3 \ 4 \ 5 \ 6 \ 7 \ 8 \ 9
Note:
The number of nodes in the given tree will be between 1 and 100. Each node will have a unique integer value from 0 to 1000. https://leetcode.com/problems/same-tree/#/description
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
https://leetcode.com/problems/leaf-similar-trees/
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.
https://s3-lc-upload.s3.amazonaws.com/uploads/2018/07/16/tree.png
For example, in the given tree above, the leaf value sequence is (6, 7, 4, 9, 8).
Two binary trees are considered leaf-similar if their leaf value sequence is the same.
Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar.
https://leetcode.com/problems/path-sum-ii/description/
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ / \ 7 2 5 1 return [ [5,4,11,2], [5,8,4,5] ]
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Source Files
¶
- averageOfLevels.go
- binaryTreePaths.go
- buildTree.go
- buildTree2.go
- constructMaximumBinaryTree.go
- convertBST.go
- countNodes.go
- diameterOfBinaryTree.go
- findMode.go
- findSecondMinimumValue.go
- findTarget.go
- findTilt.go
- flatten.go
- getMinimumDifference.go
- hasPathSum.go
- increasingBST.go
- inorderTraversal.go
- invertTree.go
- isBalanced.go
- isCousins.go
- isSameTree.go
- isSubtree.go
- isSymmetric.go
- isUnivalTree.go
- isValidBST.go
- kthSmallest.go
- leafSimilar.go
- levelOrder.go
- levelOrderBottom.go
- longestUnivaluePath.go
- lowestCommonAncestor.go
- lowestCommonAncestor2.go
- maxDepth.go
- maxPathSum.go
- mergeTrees.go
- minDepth.go
- minDiffInBST.go
- pathSum.go
- pathSum2.go
- postorder.go
- postorderTraversal.go
- preorderTraversal.go
- printTree.go
- recoverTree.go
- rightSideView.go
- sortedArrayToBST.go
- sortedListToBST.go
- sumNumbers.go
- sumOfLeftLeaves.go
- tree2str.go
- trimBST.go
- widthOfBinaryTree.go
- zigzagLevelOrder.go