2015年5月29日
摘要: Implement int sqrt(int x).Compute and return the square root of x. 1 class Solution { 2 public: 3 int mySqrt(int x) { 4 unsigned long long... 阅读全文
posted @ 2015-05-29 17:20 黄瓜小肥皂 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr... 阅读全文
posted @ 2015-05-29 16:46 黄瓜小肥皂 阅读(274) 评论(0) 推荐(0) 编辑
摘要: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For examp... 阅读全文
posted @ 2015-05-29 09:29 黄瓜小肥皂 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort. 1 class Solution { 2 public: 3 ListNode* insertionSortList(ListNode* head) { 4 ListNode *newhead=... 阅读全文
posted @ 2015-05-29 07:45 黄瓜小肥皂 阅读(109) 评论(0) 推荐(0) 编辑