摘要: There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costscost[... 阅读全文
posted @ 2015-01-24 17:05 雄哼哼 阅读(245) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文
posted @ 2015-01-24 16:44 雄哼哼 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?Has... 阅读全文
posted @ 2015-01-24 14:51 雄哼哼 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?思路:1.可以用hash表记录链表中每个节点的地址,然后遍历发现重复,即有环,否则到... 阅读全文
posted @ 2015-01-24 14:23 雄哼哼 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol... 阅读全文
posted @ 2015-01-24 13:33 雄哼哼 阅读(157) 评论(0) 推荐(0) 编辑