【033-Search in Rotated Sorted Array(在旋转数组中搜索)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4 5 6...
分类:
编程语言 时间:
2015-07-26 07:32:11
阅读次数:
170
【030-Substring with Concatenation of All Words(串联所有单词的子串)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 You are given a string, s, and a list of words, words, that are all of the same length. Find all starting...
分类:
编程语言 时间:
2015-07-26 07:32:10
阅读次数:
208
【032-Longest Valid Parentheses(最长有效括号)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses su...
分类:
编程语言 时间:
2015-07-26 07:31:04
阅读次数:
198
【027-Remove Element(删除数组中的元素)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be ch...
分类:
编程语言 时间:
2015-07-25 09:33:10
阅读次数:
165
[【028-Implement strStr() (实现strStr()函数)】](028-Implement strStr() (实现strStr()函数))【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Implement strStr().
Returns the index of the first occurrence of needle in hayst...
分类:
编程语言 时间:
2015-07-25 09:32:21
阅读次数:
152
【029-Divide Two Integers(两个整数相除)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Divide two integers without using multiplication, division and mod operator.
If it is overflow, return MAX_INT.
题目大意 不使用除法,乘法...
分类:
编程语言 时间:
2015-07-25 09:31:31
阅读次数:
174
【026-Remove Duplicates from Sorted Array(删除排序数组中的重复元素)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a sorted array, remove the duplicates in place such that each element appear only once and return the...
分类:
编程语言 时间:
2015-07-24 08:06:09
阅读次数:
191
【024-Swap Nodes in Pairs(成对交换单链表的结点)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return...
分类:
编程语言 时间:
2015-07-24 08:05:47
阅读次数:
166
【025-Reverse Nodes in k-Group(单链表中k个结点一组进行反转)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of...
分类:
编程语言 时间:
2015-07-24 08:04:47
阅读次数:
143
【021-Merge Two Sorted Lists(合并两个排好序的单链表)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of t...
分类:
编程语言 时间:
2015-07-23 08:16:37
阅读次数:
164