LeetCode 621. Task Scheduler(java)

Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks coul...

2018-02-04 09:22:54

阅读数:41

评论数:0

LeetCode 448. Find All Numbers Disappeared in an Array

Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] ...

2018-01-26 06:32:42

阅读数:13

评论数:0

非比较排序之桶排序(bucket sort)

1. 桶排序如果输入的数组里没有重复,那么一个普通数组就可以,这个数组的大小为原数组中的max - min + 1。代码如下。public static int[] bucketSort(int[] nums) { if (nums.length <= 1) return n...

2018-01-25 08:27:45

阅读数:33

评论数:0

LeetCode 347. Top K Frequent Elements(java)

Given a non-empty array of integers, return the k most frequent elements.For example, Given [1,1,1,2,2,3] and k = 2, return [1,2].Note: You may as...

2018-01-25 07:09:30

阅读数:22

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭