【035-Search Insert Position(搜索插入位置)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if...
分类:
编程语言 时间:
2015-07-27 08:16:01
阅读次数:
172
【036-Valid Sudoku(验证数独棋盘)】】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.
The Sudoku board could be partially filled, where empty cel...
分类:
编程语言 时间:
2015-07-27 08:13:29
阅读次数:
301
【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
【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