I have attached the file with the sorts. I have to show 2 sorts insertion, and selection sorts demonstration in bars. I should show the position of the bars after each run. How do i go on about doing that?
Alishaikh -3 Light Poster
Recommended Answers
Jump to PostI have attached the file with the sorts. I have to show 2 sorts insertion, and selection sorts demonstration in bars. I should show the position of the bars after each run. How do i go on about doing that?
What do you mean when you say:
I have to …
Jump to PostYou can create an array with some numbers inside.
>Then print its values,
>Call the sort method
>Print again the values.Also if you want to see how the sort progresses you can change the methods given and add some :
>System.out.printlns after each loop is run.
Every time …
Jump to PostYou don't say what doesn't work and what errors you get.
Also it would be a good idea to print the values in 1 line:
for (int scan = index+1; scan < numbers.length; scan++){ if (numbers[scan] < numbers[min]) min = scan; for(int i=0;i<numbers.length;i++) { System.out.print(numbers[i]+", "); …
All 12 Replies
Alishaikh -3 Light Poster
verruckt24 438 Posting Shark
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
hypocrisy 0 Newbie Poster
Alishaikh -3 Light Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
Alishaikh -3 Light Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
Alishaikh -3 Light Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
Alishaikh -3 Light Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.