上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 46 下一页
  2017年7月25日
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文
posted @ 2017-07-25 11:12 Beserious 阅读(139) 评论(0) 推荐(0) 编辑
  2017年7月24日
摘要: 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) 推荐(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) 推荐(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) 推荐(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) 推荐(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) 推荐(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) 推荐(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) 推荐(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) 推荐(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) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 46 下一页