0
how to sort using arrays...
i have a journal to write and theyve askede to cod e a program in which the computer outputs the numbers input by user (in any order) in ascending order...please help
3 Respuestas
+ 1
A bubble sort would be great for what you want to do. If you go on the Code Playground, SoloLearn has created one, however isn't very customisable to the fact that you can't pick whether you want to ascend or descend, view iterations etc.
I have also made one on the Code Playground, feel free to check it out :) (I'll post the code here if you like). It allows you to choose whether you want to view iterations, select ascending or descending, and input as many numbers as you like.
+ 1
Apologies, it's not letting me post the code for some reason:/ it just says internet connections problems, even though I haven't got any problems.
I'm going to bump it back up to the top on the Code Playground, scroll round a bit until you find my name and "Bubble Sort".
Sorry it's not the prettiest, nor easiest code the understand. I don't use comments that often. Plus, if you need some of it for a project, it would be really great if you would be able to understand what's going on.
0
it would be very helpful if you could post the code here