標籤:: Sort

0

H-Index

H-IndexGiven an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index. According to the definition of h-index on Wikipedia

0

Largest Number

Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. Note: The result

0

Sort List

Sort ListSort a linked list in O(n log n) time using constant space complexity. 提示 解題應用 LinkedList Pointer Sort MergeSort Default:12345678910/** * Definition for singly-linked list. * typ

0

Insertion Sort List

Insertion Sort ListSort a linked list using insertion sort. 提示 解題應用 LinkedList Pointer Sort Insertion Sort Default:12345678910/** * Definition for singly-linked list. * type ListNode stru

0

Sort Colors

Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the

0

Merge Intervals

Merge IntervalsGiven a collection of intervals, merge all overlapping intervals. For example:12Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]. 提示 解題應用 Array Array/Slice Sort In

0

Intersection of Two Arrays

Intersection of Two ArraysGiven two arrays, write a function to compute their intersection. ###For Example: 1Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element in the result

0

Intersection of Two Arrays II

Intersection of Two Arrays IIGiven two arrays, write a function to compute their intersection. For Example:1Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Note: Each element in the resul

0

Palindrome Linked List

Palindrome Linked ListGiven two strings s and t, write a function to determine if t is an anagram of s. For example:12s = "anagram", t = "nagaram", return true.s = "rat"