⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 this is many kind of sorting algorithm in c-c++ language
💻 TXT
字号:
Multi-Sort Program #1
   March 2001
   Dave Maynard -- Daxxus
   email -- maynard@cs.fsu.edu (til I graduate in Summer 2001)

There are 7 Sorts Implemented.

It covers Merge Sort, Insertion Sort, Radix Sort, Heap Sort, Bucket Sort, Quick Sort and Counting Sort.


//////////////
// OUTPUT:: //
//////////////
Upon instantiation the program gives the user a choice of the SIZE of the "Sample Size" to be sorted.
It then gives you the Statistics (SORT TIMING) for each of the sorts.
Remember -- Insertion sort the running time is O(n^2) so for large SAMPLE SIZES it takes a very long time.

////////////
// CODE:: //
////////////
The Sample-Size is taken in by standard input then used to dynamically allocate an array of that 
size to be used in the sorting arrays.
The original is filled with generic random data.

The original array is copied into a duplicate Array for each sorting algorithm so that the same 
data can be used in each (keeps the timing valid.)

These dynamic arrays are destroyed when they are done being used.

NOTE::
   The reason the arrays truly needed to be dynamic is to allow for HUGE arrays such as 1,000,000 in size.
   You would get a core dump (Linux-Unix) or a memory crash (Windows) if the arrays were not created this way.

BIG NOTE:: (heh heh...)
   There is a #define DEBUGIT at the top of the code that is commented out.
   If you want to "see" that each algorithm is working properly -- then UN-comment that line.
   It will print out the data to the screen -- using a stepsize (so it doesn't print out the whole thing...)

///////////////////
// Environment:: //
///////////////////
This code can be directly compiled in:
   Visual C++ 6.0. (I hate this compiler...)
   Bloodshed Dev-C++ (I LOVE this compiler...)  A wonderful environment to code in.   
                                                Get it at www.bloodshed.net
   All Linux-Unix Compilers
      
////////////////////////////////////
// Sample Makefile for Linux-Unix //  -- ** MAKE SURE THE INDENTS ARE TABS NOT SPACES ** --
////////////////////////////////////
Label:
	g++ -o Multi-Sort1 Multi-Sort1.cpp



 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -