bubblesort question

Discussion in 'Java' started by Ray Leon, Jul 19, 2008.

  1. Ray Leon

    Ray Leon Guest

    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

    LESSON 8
    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
    1st Pass Barney Pebbles Pebbles Pebbles
    Pebbles
    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
    Pebbles Fred Fred Fred
    2nd Pass Fred Pebbles Dino Dino
    Dino Dino Pebbles Pebbles
    Wilma Wilma Wilma Wilma

    Barney Barney Barney
    Fred Dino Dino
    3rd Pass Dino Fred Fred
    Pebbles Pebbles Pebbles
    Wilma Wilma Wilma

    4th Pass
    Ray Leon, Jul 19, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sean
    Replies:
    1
    Views:
    591
    Cowboy \(Gregory A. Beamer\)
    Oct 20, 2003
  2. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Quick Question - Newby Question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Feb 14, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    646
    Iain Norman
    Feb 16, 2005
  3. =?Utf-8?B?YW5kcmV3MDA3?=

    question row filter (more of sql query question)

    =?Utf-8?B?YW5kcmV3MDA3?=, Oct 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    943
    Scott Allen
    Oct 6, 2005
  4. Philip Meyer
    Replies:
    0
    Views:
    417
    Philip Meyer
    Nov 30, 2003
  5. Ray Leon

    bubblesort question

    Ray Leon, Jul 19, 2008, in forum: Java
    Replies:
    1
    Views:
    305
    Arved Sandstrom
    Jul 20, 2008
Loading...

Share This Page