码迷,mamicode.com
首页 >  
搜索关键字:selection sort    ( 14049个结果
c++ 快速排序
介绍给大家一个快速排序的方法: void sort(int  a[ ], int l, int r) { int i = l; int j = r; int mid = a[(i+j)/2];      do   {         while(a[i] while(a[j] >mid ) j--; if( i { swap( a[i], a[j] ); }...
分类:编程语言   时间:2014-06-20 13:15:03    阅读次数:292
数据结构 - 简单选择排序(simple selection sort) 详解 及 代码(C++)
数据结构 - 简单选择排序(simple selection sort)本文地址: http://blog.csdn.net/caroline_wendy/article/details/28601965 选择排序(selection sort) : 每一趟在n-i+1个记录中选取关键字最小的记录作为有序序列中第i个记录.简单选择排序(simple selection sort) : 通过n-i次关键字之间的比较, 从n-i+1个记录中选出关键字最...
分类:编程语言   时间:2014-06-20 09:48:25    阅读次数:332
[leetcode] Insertion Sort List
题目链接: here。题目描述: Sort a linked list using insertion sort. 题目要求使用插入排序的方法来实现单链表的排序。插入排序是一种简单的排序,算法描述参考维基百科,或者《算法导论》。 下面是我实现的代码: 1 /** 2 Author:...
分类:其他好文   时间:2014-06-12 00:39:40    阅读次数:284
javascript 获取光标所选中的内容并插入到另一个文本框中(兼容ie和ff)
项目中正好用到 做下笔记方便以后查找ie获取光标的位置使用document.selection.createRange()火狐下使用document.getElementById(id).selectionStart 和document.getElementById(id).selectionEnd...
分类:编程语言   时间:2014-06-11 21:49:24    阅读次数:291
关于document.selection和TextRange对象的介绍
document.selection只有IE支持window.getSelection()也只有FireFox和Safari支持,都不是标准语法。 selection 对象代表了当前激活选中区,即高亮文本块,或文档中用户可执行某些操作的其它元素。selection 对象的典型用途是作为用户的输入,....
分类:其他好文   时间:2014-06-11 12:21:51    阅读次数:284
count(*)
count(*)是否能用到索引,用索引是高效还是低效select count(*) from aa ;首先看是否会走索引,经过试验发现,他没有走索引它的执行计划 select statement sort aggregate table access full别说是否高效了,他连索引都没有走,索引不...
分类:其他好文   时间:2014-06-11 12:00:01    阅读次数:282
黑马程序员-集合工具类和1.5新特性
集合框架的工具类:collecttionsCollections 的方法全是静态的 List没有排序功能,所以java定义了Collections工具类。 比较器无法传给list,只能传给Set.但是集合工具类有此方法1.排序: comparable: sort(List list) 根据元素的自然...
分类:其他好文   时间:2014-06-11 08:54:10    阅读次数:218
适配器模式
类的适配器模式classCIntegerSortAdapter:DoubleSort,Sortable{publicint[]Sort(int[]number){double[]dnum=newdouble[number.Length];int[]inum=newint[number.Length]...
分类:其他好文   时间:2014-06-11 08:04:50    阅读次数:242
Algorithm | Sort
Bubble sortBubble sort, sometimes incorrectly referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the...
分类:其他好文   时间:2014-06-07 11:30:59    阅读次数:390
C++ Primer 学习笔记_46_STL实践与分析(20)--容器特有的算法
STL实践与分析--容器特有的算法 与其它顺序容器所支持的操作相比,标准库为list容器定义了更精细的操作集合,使它不必仅仅依赖于泛型操作。当中非常大的一个原因就是list容器不是依照内存中的顺序进行布局的,不支持随即訪问,这样,在list容器上就不能使用随即訪问迭代器的算法,如sort等;还有其....
分类:编程语言   时间:2014-06-07 06:12:44    阅读次数:245
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!