F_G

许多问题需要说清楚就可以&&走永远比跑来的重要

导航

2015年9月3日 #

[Lintcode] Kth Smallest Number in Sorted Matrix

摘要: Kth Smallest Number in Sorted MatrixFind thekth smallest number in at row and column sorted matrix.Have you met this question in a real interview?YesE... 阅读全文

posted @ 2015-09-03 20:41 F_G 阅读(956) 评论(0) 推荐(1) 编辑

[Leetcode] 丑数问题

摘要: Ugly NumberWrite a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, ... 阅读全文

posted @ 2015-09-03 20:38 F_G 阅读(356) 评论(0) 推荐(1) 编辑

[算法] 排序方法复杂度、稳定性汇总

摘要: 对几种排序方法进行简单总结。排序类型时间复杂度空间复杂度稳定性冒泡排序O(N^2)O(1)稳定插入排序O(N^2)O(1)稳定选择排序O(N^2)O(1)不稳定希尔排序O(N^2)O(1)不稳定堆排序O(NlogN)O(1)不稳定快速排序O(NlogN)O(logN)不稳定归并排序O(NlogN)O... 阅读全文

posted @ 2015-09-03 10:41 F_G 阅读(152) 评论(0) 推荐(0) 编辑

[算法] shell sort

摘要: public void sort(int[] list) { int gap = list.length / 2; while (1 = 0 && temp < list[j]; j = j - gap) { list[j + gap] = list[j];... 阅读全文

posted @ 2015-09-03 10:34 F_G 阅读(347) 评论(0) 推荐(0) 编辑