For example if we have an array array[5]={9,1,6,7,3};
How do we sort it in an ascending order?
I'm asking here because I missed this lecture and now my teacher is unavailable. Please tell me how i cant sort it. I'm supposed to sort it using loop(s) and an if or if-else condition.
I know how to bubble sort. As I recall, my teacher told us about three types of sorting; bubble sort, selection sort and insertion sort. He hasn't taught the the class insertion sort yet.
This is my bubble sort program;
My teacher hasn't taught the class to how to use the swap function and we are not supposed to use it even if we know how to use it. We are supposed to store the number in a different variable like i have done in the bubble sort above.
Oh and whats the difference between bubble sort and selection sort?