by Editorial | May 28, 2021 | Grade 12, Grade 12 - Search and Sort
You have watched the video and you now understand how the bubblesort algorithm works. You understand why sorting integers is straightforward and why we need to use “compareTo” when sorting String. Now you just want the code . . . Click here for bubble...
by Editorial | Feb 28, 2021 | Grade 12, Grade 12 - OOP, Grade 12 - Search and Sort
Inheritance is an important element of OOP programming. Using Carol Lewis’ Inheritance workshop we will re-create her example of an array of Dogs. This array will be a mixed array because some of the elements will be of the class “Dogs” while others...
by Editorial | Feb 28, 2021 | Grade 11, Grade 12, Grade 12 - Search and Sort
SORT ARRAY OF OBJECTS – by name – by date The bubble sort can sort numbers, Strings and arrays of objects. For an animation on how the bubble sort algorithm works click here. You may need to revise how the String method “compareTo” works. To...
by Editorial | Feb 27, 2021 | Grade 11, Grade 12, Grade 12 - Search and Sort, PWC grade 12 - All
The bubble sort algorithm offers a simple solution to sorting items in an array; the array can be of a primitive data type e.g. int or it can be an array of objects. The bubble sort works for both numerical values as well as for String and char. SORT NUMBERS On...