This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: asort(num); } } (a) Specify the name of the sorting method carried out by asort() method. (b) Show the output after executing java Test . (c) A better algorithm for asort() method is that it can terminate the sorting process earlier once it has found the elements in the array are in ascending order. Modify the asort() method to this early terminating version. CC2203 Data Structures and Algorithms Sem 2, 2010-2011 Page 2 of 2 Exercise 2 If the bubble sort is used for the following sequence of integers: 4, 7, 5, 9, 6, 3, 2, 8, 1 show the output of the first six bubbling passes. Review 1. Download bookprog.zip from Moodle. 2. Doubel-click bookprog.zip to extract bookprog folder. The bookprog folder contains all Java codes presented in the lectures. 3. Read the corresponding lecture slides ( Lesson Notes 6) for the compilation and execution. Understand those Java source codes, compile and execute them....
View Full Document