|
|
Created by Nathan Hunsdale
about 12 years ago
|
|
Sorting algorithms
The end result will always be the _____ no matter which algorithm you use to sort it
Sorting Algorithms
The choice of algorithm affects only the _____ and _____ _____ of the program
Sorting Algorithms
Bubble sort, Selection Sort and Insertion Sort are _____ to program but _____
Sorting Algorithms
Merge Sort is _____ than Selection Sort and Insertion Sort but _____ to program
Bubble Sort
The bubble sort compares _____ elements. The first and second elements are compared and then swapped if out of order and this continues the whole way down the list
Bubble Sort
The process is repeated until there are no more _____ to be made. This is when it has finished
Bubble Sort
The bubble sort keeps track of the occurring swaps by use of a _____
Selection Sort
_____ but _____ sorting algorithm
Selection Sort
Its first iteration selects the _____ element in the array and swaps it with the _____ element
Selection Sort
The 2nd iteration selects the _____ smallest item and swaps it with the _____ elements. This process is repeated until the list is done
Selection Sort
Efficiency
This algorithm runs in _____ time.
Selection Sort
Efficiency
Contains _____ for loops
Selection Sort
Efficiency
The outer for loop iterates over the first _____ elements in the array
Selection Sort
Efficiency
The inner for loop iterates over each item in the remaining array searching for the _____ element
Selection Sort
Efficiency
In Big O terms, smaller terms drop out and constants are ignored , leaving a final big O of _____
Insertion Sort
Another, _____ but _____ method
Insertion Sort
The first iteration of this algorithm takes the _____ element in the array, and if it is less than the first element, swaps the two
Insertion Sort
The second iteraton looks at the _____ element and inserts it into the correct position and puts it into the correct position with respect to the elements that have already been sorted; the first 3 items are now in order. This continues
Quick Sort
This is a divide and conquer algorithm. This means that the data is separated into _____ parts (divide) which are individually sorted(conquered) and then combined
Quick sort
If the array contains only _____ element or _____ elements then the array is sorted.
Quick sort
What is the pivot element and what is it used for?
Quick sort
The 2 arrays created from the pivot element are sorted _____
Quick sort
The arrays are then _____
Quick sort
Quick sort can then be implemented to sort "in place". What does this mean?
Hide known cards