Anyone here can help me code a bubble sort algorithm code in C++ programming? I need to separate it in different file, which include the "h" file and the "cpp" file. The sorting display must be have 7 screen which the sorting is sort in step and show in step. Thank you all expert here.

google for sorting algorithms and you will find the algorithm you are looking for. Not sure what you mean by that last statement Get a program working with the bubble sort all coded in one file, after that works then you can split out the bubble sort into a different source file and create the header file.

>>sorting display must be have 7 screen which the sorting is sort in step and show in step.
not sure what you mean by that -- can you post an example

erm... i didn't quite understand what you're asking... could you explain yourself please?

>>sorting display must be have 7 screen which the sorting is sort in step and show in step.
not sure what you mean by that -- can you post an example

yes... please do...

Anyone here can help me code a bubble sort algorithm code in C++ programming? I need to separate it in different file, which include the "h" file and the "cpp" file. The sorting display must be have 7 screen which the sorting is sort in step and show in step. Thank you all expert here. I mean that the user need to input 8 int number, and the bubble sort is perform by step, which have 7 screen. The 1st screen is the user input number, the 2nd screen is sort if the 2nd number is smaller than the 1st number but the rest number remain the same place. On the 7th scree, all the number is sort in ascending order.

oooooohhh... so you want to sort it from least to greatest, and the program must show the whole process of sorting? am i right?

oooooohhh... so you want to sort it from least to greatest, and the program must show the whole process of sorting? am i right?

Ya.. It sort from least to greatest. I juz a small program i figure out. Hope u can help me code out, as i fresh in C++. Thank you.

if you don't have any code for us to look at, i'm sorry... i can't help you that much... all i can do is tell you how to do it...

you must create a bubble code that compares every number in a for loop, to see if the previous number is equal or smaller than the next... if it is smaller, it must pass to the next one, if not, it must call the function again and switch the numbers, and try again...

This article has been dead for over six months. Start a new discussion instead.