随笔分类 -  Sorting

sort array and sorted array
(88) Merge Sorted Array
摘要:Given two sorted integer arrays A and B, merge B into A as one sorted array. Note:You may assume that A has enough space (size that is greater or equa... 阅读全文

posted @ 2015-02-11 15:56 lh_chuang 阅读(117) 评论(0) 推荐(0)

(80)Remove Duplicates from Sorted Array II
摘要:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array A = [1,1,1,2,2,3],Your function should ... 阅读全文

posted @ 2015-02-11 15:43 lh_chuang 阅读(98) 评论(0) 推荐(0)

(26)Remove Duplicates from Sorted Array
摘要:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for... 阅读全文

posted @ 2015-02-11 15:38 lh_chuang 阅读(99) 评论(0) 推荐(0)

基本的排序算法
摘要:基本的排序算法Selection sort选择排序是一种简单直观的排序算法。它的工作原理如下:1:首先在未排序序列中找到最小元素,存放到排序序列的起始位置2:然后,再从剩余未排序元素中继续寻找最小元素,然后放到已排序序列的末尾。3:以此类推,直到所有元素均排序完毕。Source : Selectio... 阅读全文

posted @ 2015-02-09 21:33 lh_chuang 阅读(245) 评论(0) 推荐(0)

Sorting
摘要:This webpage covers the space and time Big-O complexities of sorting algorithms used in Computer Science.Follow: sorting of big O实用的算法可视化工具:WIn32 Linu... 阅读全文

posted @ 2015-02-09 17:02 lh_chuang 阅读(116) 评论(0) 推荐(0)

导航