Problem Definition: Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space?思路:为了达到O(1)...
分类:
其他好文 时间:
2015-07-15 20:52:39
阅读次数:
104
Unique Paths II
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and 0 res...
分类:
其他好文 时间:
2015-07-15 15:05:17
阅读次数:
104
题目:
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct solutions.
题意:
接上题N-Queens problem,这里只是要求返回所有的不同的解的数目。
算法分析:
思路与上题...
分类:
编程语言 时间:
2015-07-15 11:06:36
阅读次数:
141
题目:
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
题意:
给定一个 n x n 的二维矩阵,来表示一副图像。
把图像旋转90度(顺时针...
分类:
编程语言 时间:
2015-07-14 22:46:32
阅读次数:
320
leetcode - Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up:Can you solve...
分类:
其他好文 时间:
2015-07-14 19:57:11
阅读次数:
96
234 Palindrome Linked List链接:https://leetcode.com/problems/palindrome-linked-list/
问题描述:
Given a singly linked list, determine if it is a palindrome.Follow up:
Could you do it in O(n) time and O(...
分类:
其他好文 时间:
2015-07-14 18:06:54
阅读次数:
85
leetcode -Palindrome Linked ListGiven a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space? 1 /...
分类:
其他好文 时间:
2015-07-14 17:13:22
阅读次数:
82
80 Remove Duplicates from Sorted Array II链接:https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
问题描述:
Follow up for “Remove Duplicates”:
What if duplicates are allowed at most twic...
分类:
其他好文 时间:
2015-07-14 15:37:17
阅读次数:
86
题目:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a s...
分类:
其他好文 时间:
2015-07-13 22:02:44
阅读次数:
124
Well, a follow-up for the problemLowest Common Ancestor of a Binary Search Tree. However, this time you cannot figure out which subtree the given node...
分类:
其他好文 时间:
2015-07-13 17:47:40
阅读次数:
87