摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
Sort a linked list using insertion sort. 1 class Solution { 2 public: 3 ListNode* insertionSortList(ListNode* head) { 4 ListNode *newhead=... 阅读全文