上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? 阅读全文
posted @ 2014-12-05 11:32 Mr.do 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? tags提示:two pointers 采用“快慢双指针”的方法来判断: 每次 阅读全文
posted @ 2014-12-04 20:45 Mr.do 阅读(108) 评论(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 complet 阅读全文
posted @ 2014-12-03 18:08 Mr.do 阅读(121) 评论(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 @ 2014-12-02 14:44 Mr.do 阅读(113) 评论(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 @ 2014-12-01 13:42 Mr.do 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime 阅读全文
posted @ 2014-11-27 21:15 Mr.do 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appears twice except for one. Find that single one. Your algorithm should have a linear runtime complexity. 阅读全文
posted @ 2014-11-27 14:58 Mr.do 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree. 阅读全文
posted @ 2014-11-25 17:09 Mr.do 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree. 阅读全文
posted @ 2014-11-25 17:00 Mr.do 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2014-11-23 13:57 Mr.do 阅读(88) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页