sorting data by size.
-
ok... i have an array that its size always changes... like array[inc]; array is the array ofcource and inc //incriment. the program allows you to add a number to a list of numbers... then you press 'p', and you would print the number list. what i want to do is make it for if you press 's' then the program would sort all the data in array[] to least to greatest. i have s in a switch of menu "which is a char" so... case 's' : { ... //least to greates program } how would i accomplish this? thanks! ~SilverShalkin :rose:
-
ok... i have an array that its size always changes... like array[inc]; array is the array ofcource and inc //incriment. the program allows you to add a number to a list of numbers... then you press 'p', and you would print the number list. what i want to do is make it for if you press 's' then the program would sort all the data in array[] to least to greatest. i have s in a switch of menu "which is a char" so... case 's' : { ... //least to greates program } how would i accomplish this? thanks! ~SilverShalkin :rose:
Bubblesort was one of the easiest sorting algorithms I used to implement for most of my school assignments. I wasn't very efficient, but it was easy to implement. Nish
The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday
-
Bubblesort was one of the easiest sorting algorithms I used to implement for most of my school assignments. I wasn't very efficient, but it was easy to implement. Nish
The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday
and if you dont want to write your own try using the quicksort that is built into the c runtimes :)
situations to avoid #37:
"good morning ... how many sugars do you take in your coffee ... and what was your name again?"coming soon: situations to avoid #38: "...and the dog was there too?"
-
and if you dont want to write your own try using the quicksort that is built into the c runtimes :)
situations to avoid #37:
"good morning ... how many sugars do you take in your coffee ... and what was your name again?"coming soon: situations to avoid #38: "...and the dog was there too?"
so... bubblesort and quicksort? if it is possible.. can you show me an example? if not ill try and figuer how it works in msdn. thanks ~SilverShalkin :rose:
-
Bubblesort was one of the easiest sorting algorithms I used to implement for most of my school assignments. I wasn't very efficient, but it was easy to implement. Nish
The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday
This link does not take you to Sort
-
This link does not take you to Sort
Learning wrote: This link does not take you to Sort Which link? :confused: Nish :confused:
The posting stats are now in PDF:- http://www.busterboy.org/codeproject/ Feel free to make your comments. Updated - May 04th, Saturday