Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > bubblesort question

Reply
Thread Tools

bubblesort question

 
 
Ray Leon
Guest
Posts: n/a
 
      07-19-2008
LESSON 8

Dear Sirs or Madam:

I need some assistance with a bubble sort question that I have completed and
think to be correct. I am just a bit unsure since there is an additional
pass (4th pass) in the original question (below), which make me wonder if
there is something I left out. Any help is greatly appreciated. The actual
document and arrows showing the sorts I have uploaded to my website:

http://www.popeyeray.com/bubblesort.htm

1. Consider an array with these elements: Pebbles, Barney, Wilma, Fred and
Dino. Apply the bubble sort technique to sort the array in alphabetical
order. Show all passes. (List the order before and after each pass). (50
points)





Original List
J = 1

J = 2

J = 3

J = 4













Pebbles

Barney

Barney

Barney

Barney

First
Barney

Pebbles

Pebbles

Pebbles

Pebbles

Pass
Wilma

Wilma

Wilma

Fred

Fred


Fred

Fred

Fred

Wilma

Dino


Dino

Dino

Dino

Dino

Wilma















J = 1

J = 2

J = 3















Barney

Barney

Barney

Barney



Second
Pebbles

Fred

Fred

Fred



Pass
Fred

Pebbles

Dino

Dino




Dino

Dino

Pebbles

Pebbles




Wilma

Wilma

Wilma

Wilma


























Barney

Barney

Barney





Third
Fred

Dino

Dino





Pass
Dino

Fred

Fred






Pebbles

Pebbles

Pebbles






Wilma

Wilma

Wilma






































Fourth










Pass




































 
Reply With Quote
 
 
 
 
Arved Sandstrom
Guest
Posts: n/a
 
      07-20-2008
"Ray Leon" <(E-Mail Removed)> wrote in message
news:48826e1f$0$87065$(E-Mail Removed)...
> LESSON 8
>
> Dear Sirs or Madam:
>
> I need some assistance with a bubble sort question that I have completed
> and think to be correct. I am just a bit unsure since there is an
> additional pass (4th pass) in the original question (below), which make me
> wonder if there is something I left out. Any help is greatly appreciated.
> The actual document and arrows showing the sorts I have uploaded to my
> website:
>
> http://www.popeyeray.com/bubblesort.htm
>
> 1. Consider an array with these elements: Pebbles, Barney, Wilma, Fred and
> Dino. Apply the bubble sort technique to sort the array in alphabetical
> order. Show all passes. (List the order before and after each pass). (50
> points)

[ SNIP ]

You need one pass where there are no swaps in order for the algorithm to
know that it's done.

AHS


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bubblesort question Ray Leon Java 0 07-19-2008 10:55 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM



Advertisments