-
maopao_youhua
冒泡优化:
如果一个序列是int n[]={1,2,3,4,5,6,7,8,9} , 用正常的冒泡排序需要排8次才行,优化之后1次就好,也就是说序列越接近于正常序列,改进之后的冒泡排序的次数就越少,这样会给一个冒泡排序算法带了很大的效率。
思想:添加一个boolean变量用来判断冒泡是否是已经排好了顺序,如果boolean的值为false,说明是已经排好了,如果boolean的值true,说明没有排好,继续排。(If a sequence is int n [] = {, 1,2,3,4,5,6,7,8,9} need to row 8 times the job after optimization times like normal bubble sort, but alsomeans that the sequence is more close to the normal sequence, improved bubble sort, the less the number, which would give a bubble sort algorithm with a great deal of efficiency.
Idea: add a boolean variable used to determine the bubble whether it is already lined up the order, if the boolean is false, indicating already lined up, if the boolean value of true, did not line up, continue to row.)
- 2012-04-18 00:33:45下载
- 积分:1
-
elevator
电梯模拟,实现一个模拟电梯的环境,用C程序实现的,封装良好(elevator modify)
- 2021-04-22 15:38:48下载
- 积分:1
-
build_max_heap
最大堆排序算法,C++语言编写,原程序,算法导论(The maximum heap sort algorithm, C++ language)
- 2015-01-26 16:15:21下载
- 积分:1
-
algorithm
一本介绍各种算法的经典书籍,计算机算法设计与分析(A classic book introduces a variety of algorithms, algorithm design and analysis of computer)
- 2011-08-08 22:13:02下载
- 积分:1
-
tongxunlu20
具有数据插入、修改、删除、显示、和查询功能的电话簿管理程序。
数据包括:人名、工作单位、电话号码、和E-mail地址。
可对记录中的姓名和电话号码进行修改。
可增加或删除记录。
可显示所有保存的记录。
可按人名或电话号码进行查询。
附加功能:
可修改单个记录的各项内容。
可重新建立电话簿。
可按人名或号码进行排序。
可统计名片数目及可再添加数目。
可插入单个名片并不破坏原有顺序(With the data to insert, modify, delete, display, and query functions of the phone book management program. The data include: the names, work units, phone number, and E-mail address. Can be modified to record the name and phone number. Increase or delete records. You can display all the records kept. According to the names or telephone number for queries. Additional features: you can modify the content of a single record. Can re-establish a Phonebook. According to the names or numbers to be sorted. Statistical card number and add the number. Insert a single card does not destroy the original order)
- 2012-05-28 12:48:27下载
- 积分:1
-
d
说明: 有助于c++的初学者在平日的学习中更好的学习(Contribute to better learning c++ beginners learning on weekdays)
- 2013-11-29 14:32:18下载
- 积分:1
-
K_Merge
文件的多路归并排序算法, C++描述(要求待排序文件已经事先有序)(C++ implementation of K-Merge Algorithm)
- 2010-08-03 10:24:48下载
- 积分:1
-
huisuo
实现回溯算法,能解决八皇后问题等~~算法结果优化,时间复杂度较小(Implement backtracking algorithms can solve the eight queens problem, etc. ~ ~)
- 2011-12-14 11:59:39下载
- 积分:1
-
c语言,码图合集
说明: a set of uestc computer academic matu
- 2020-04-05 20:19:20下载
- 积分:1
-
sorting
该文件描述了排序算法的实验指导报告,通过本实验,你可以了解插入排序、选择排序、希尔排序、堆排序、冒泡、双向冒泡、快速排序、归并排序、递归的归并排序、基数排序等多种排序方法的实验(The document describes the experimental guidance of the sorting algorithm, through this experiment, you can learn about the insertion sort, selection sort, shell sort, heap sort, bubble, two-way bubble, quick sort, merge sort, merge sort recursive basesorting a variety of sorting methods experiment
)
- 2012-06-08 11:28:55下载
- 积分:1