#树和图
该标签下的全部文章。
First Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.
Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.
Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.
Leaf Path Sum
Get all the paths (always starts from the root and ends at leaf) in a binary tree, whose sum would be equal to
Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values.