原创 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 l

原创 Leetcode Symmetric Tree 對稱二叉樹

題目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, th

原创 Leetcode Linked List Cycle II 循環鏈表入口

題目: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. 分析: 個人覺得這題的原理沒有

原创 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 f

原创 Leetcode Reorder List 鏈表重排序

題目: Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-plac

原创 Leetcode Path Sum

題目: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values

原创 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

原创 Leetcode Binary Tree Right Side View

題目: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can

原创 Leetcode Populating Next Right Pointers in Each Node

題目: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi

原创 Leetcode Populating Next Right Pointers in Each Node II

題目: Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binar

原创 Leetcode Sum Root to Leaf Numbers

題目: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An exam

原创 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 duplicat

原创 Leetcode Single Number

題目: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algor

原创 Leetcode Unique Paths II

題目: Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths wou

原创 Leetcode House Robber

題目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money s