【098-Validate Binary Search Tree(验证二叉搜索树)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The lef...
分类:
编程语言 时间:
2015-08-06 08:17:54
阅读次数:
234
【086-Partition List(将单链表进行分区)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You...
分类:
编程语言 时间:
2015-08-05 07:47:52
阅读次数:
177
【088-Merge Sorted Array(合并排序数组)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.
Note:
You may assume that nums1...
分类:
编程语言 时间:
2015-08-05 07:46:52
阅读次数:
149
【081-Search in Rotated Sorted Array II(搜索旋转的排序数组)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Follow up for “Search in Rotated Sorted Array”:
What if duplicates are allowed?
Would this affect the run-t...
分类:
编程语言 时间:
2015-08-04 08:16:20
阅读次数:
154
【082-Remove Duplicates from Sorted List II(排序链表中删除重复元素II)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers f...
分类:
编程语言 时间:
2015-08-04 08:15:59
阅读次数:
201
【083-Remove Duplicates from Sorted List(排序的单链表中删除重复的结点)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,...
分类:
编程语言 时间:
2015-08-04 08:15:48
阅读次数:
151
【078-Subsets(子集)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a set of distinct integers, nums, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.
The solu...
分类:
编程语言 时间:
2015-08-03 07:51:16
阅读次数:
190
【070-Climbing Stairs(爬楼梯)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct...
分类:
编程语言 时间:
2015-08-03 07:50:48
阅读次数:
177
【079-Word Search(单词搜索)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell,...
分类:
编程语言 时间:
2015-08-03 07:49:37
阅读次数:
131
【064-Minimum Path Sum(最小路径和)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers...
分类:
编程语言 时间:
2015-08-02 06:23:02
阅读次数:
928