摘要: Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.Hide TagsHash TableMath给出平面上的点,问一条直线最多穿过几个点.要不是之前看过这个... 阅读全文
posted @ 2015-06-25 18:20 穆穆兔兔 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort.Hide TagsLinked ListSort分析:把链表分成两部分:排好序的和为排序的,排好序的以NULL结尾,cur插在preInsertion和insertion之间,next保存cur->next. 另外... 阅读全文
posted @ 2015-06-25 16:14 穆穆兔兔 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu... 阅读全文
posted @ 2015-06-25 11:45 穆穆兔兔 阅读(220) 评论(0) 推荐(0) 编辑