摘要:
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 一个+1 一个+2 看看能不能相遇。注意代码不要写乱了...以后尽量用p1 p2
阅读全文
posted @ 2017-07-24 20:38
Beserious
阅读(113)
推荐(0)
编辑
摘要:
Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex
阅读全文
posted @ 2017-07-24 17:36
Beserious
阅读(117)
推荐(0)
编辑
摘要:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan
阅读全文
posted @ 2017-07-24 17:30
Beserious
阅读(142)
推荐(0)
编辑
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple
阅读全文
posted @ 2017-07-24 16:09
Beserious
阅读(126)
推荐(0)
编辑
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction
阅读全文
posted @ 2017-07-24 14:54
Beserious
阅读(130)
推荐(0)
编辑
摘要:
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm to us
阅读全文
posted @ 2017-07-24 12:48
Beserious
阅读(165)
推荐(0)
编辑
摘要:
Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 注意左右的边界赋值
阅读全文
posted @ 2017-07-24 12:19
Beserious
阅读(123)
推荐(0)
编辑
摘要:
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F
阅读全文
posted @ 2017-07-24 11:54
Beserious
阅读(109)
推荐(0)
编辑
摘要:
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l
阅读全文
posted @ 2017-07-24 11:30
Beserious
阅读(109)
推荐(0)
编辑