Construct Binary Tree from Preorder and Inorder Traversal Given preorder and inorder traversal of a tree, cons…
分类:LeetCode题目解答
[LeetCode] Concatenated Words 连接的单词
Given a list of words (without duplicates), please write a program that returns all concatenated words …
[LeetCode] Design Circular Deque 设计环形双向队列
Design your implementation of the circular double-ended queue (deque). Your implementation should suppo…
[LeetCode] Maximum Binary Tree 最大二叉树
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: …
LeetCode | Same Tree
题目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considere…
[LeetCode] Reverse Nodes in k-Group 每k个一组翻转链表
Given a linked list, reverse the nodes of a linked list k at a time and return its modified l…
[LeetCode] Special Binary String 特殊的二进制字符串
Special binary strings are binary strings with the following two properties: The number of …
[Lintcode] Nth to Last Node in List 链表倒数第N个节点
Nth to Last Node in List Find the nth to last element of a singly linked list. The minimum number of nodes in …
[Leetcode] Best Time to Buy and Sell Stock 买卖股票的最佳时机
Best Time to Buy and Sell Stock I Say you have an array for which the ith element is the price of a given stoc…
[LeetCode] ZigZag Converesion 之字型转换字符串
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like thi…
[LeetCode] Combinations 组合项
Given two integers n and k, return all possible combinations of k numbers out …
[LeetCode] House Robber II 打家劫舍之二,House Robber,House Robber,House Robber,House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of…