2013年3月17日
摘要: 前段时间找实习的时候,为了学习算法和数据结构,自己总结和其他渠道得来了一些基本的排序和查找算法,使用C++的模板实现,在此不进行复杂度分析只作为日后使用作参考,直接上代码。 一、排序 1.直接插入templatevoidInsertionSort(TypeArray[],intlength){intindex,j;Typetemp;for(index=1;index0&&tempvoidSelectionSort(TypeArray[],intlength){intindex,j;intsmallIndex;Typetemp;for(index=0;indexvoidBubbl 阅读全文
posted @ 2013-03-17 17:33 糊涂先生 阅读(349) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-03-17 00:50 糊涂先生 阅读(28) 评论(0) 推荐(0)