This textbook is available atAmazon.com Logo
Java Programming 9th Edition

Java Programming (9th Edition)

Book Edition9th Edition
Author(s)Farrell
ISBN9781337397070
PublisherCengage
SubjectComputer Science
Sorting Array Elements Using the Bubble Sort Algorithm
TWO TRUTHS & A LIE
Sorting Array Elements Using the Insertion Sort Algorithm
TWO TRUTHS & A LIE
Using Two-Dimensional and Other Multidimensional Arrays
TWO TRUTHS & A LIE
Using the Arrays Class
TWO TRUTHS & A LIE
Using the ArrayList Class
TWO TRUTHS & A LIE
Creating Enumerations
TWO TRUTHS & A LIE
Chapter 9, Sorting Array Elements Using the Bubble Sort Algorithm, TWO TRUTHS & A LIE, Exercise 01
Page 423

TWO TRUTHS & A LIE

 

  1. In an ascending bubble sort, you compare pairs of items, swapping them if they are out of order, so that the largest items "bubble" to the top of the list, eventually creating a sorted list.
  2. When you sort objects, you usually want to sort based on a particular object field.
  3. When you make a swap while sorting an array of objects, you typically swap entire objects and not just the field on which the comparison is made.

Answer

The answer is

  1. false
  2. true
  3. true
Did you like this example?
Subscribe for full access
Page 423