原创 LeetCode--Binary Tree Zigzag Level Order Traversal

Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then ri

原创 LeetCode--Same Tree

Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the

原创 LeetCode--Convert Sorted Array to Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem,

原创 LeetCode--Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates d

原创 LeetCode--Unique Binary Search Trees

Given n, how many structurally unique BST’s (binary search trees) that store values 1…n? For example, Given n = 3,

原创 LeetCode--Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this bi

原创 LeetCode--Construct Binary Tree from Preorder and Inorder Traversal

Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do

原创 LeetCode--Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from

原创 Leetcode--Restore IP Addresses

Given a string containing only digits, restore it by returning all possible valid IP address combinations. For exam

原创 LeetCode--Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, leve

原创 LeetCode--Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from t

原创 Leetcode--Binary Tree Inorder Traversal

Given a binary tree, return the inorder traversal of its nodes’ values. For example: Given binary tree [1,null,2,3

原创 LeetCode--Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level

原创 LeetCode--Unique Binary Search Trees II

Given an integer n, generate all structurally unique BST’s (binary search trees) that store values 1…n. For example

原创 LeetCode-- Convert Sorted List to Binary Search Tree

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For t