English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to write a java program in JCreator which will create an unsorted array of integers, will sort the elements in the array and output the sorted array.

I want to create a static array to hold the integers 5,10,8,16,20,17,18,11,1,3,13,19 in that order. Write a static method called swap() which will swap the integers in two adjacent array positions. Write a static method called bubble() which will call the swap method and sort the elements of the array into assending order. Write a static method called formatOutput() to print the sorted array. Call bubble() and formatOutput() in the main method.

I havent got any code as I dont even know where to start!

Please help

2006-11-27 21:29:33 · 4 answers · asked by Princess Peach 3 in Computers & Internet Programming & Design

4 answers

http://www.planetsourcecode.com/vb/default.asp?lngWId=2

is a good place to start, all about java ... loads of templates

2006-11-27 21:33:10 · answer #1 · answered by Splishy 7 · 1 0

Wikipedia has a reliable website with a table itemizing the super O of many diverse sorting algorithms. i might choose quicksort because of the fact it incredibly is quickly and incredibly recognizable, people'd be all like "omg he can code quicksort" :)

2016-12-14 08:01:05 · answer #2 · answered by lesniewski 4 · 0 0

Here's a description of a bubble sort:
http://en.wikipedia.org/wiki/Bubble_sort

This should help you for starters.

Rawlyn.

2006-11-27 21:31:44 · answer #3 · answered by Anonymous · 0 0

google is your best friend

2006-11-27 21:35:59 · answer #4 · answered by SKK P 2 · 0 0

fedest.com, questions and answers