1/11
9.1; 9.2; 9.3; 9.4; 9.5;
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
sorting algorithm
a technique for stepping through an array and rearranging its contents in some order
ascending order
order of the values in the array which are stored from lowest to highest
descending order
order of the values which are stored from highest to lowest
bubble sort, selection sort, insertion sort
three sorting algorithms to sort data in an array
bubble sort
sort algorithm that makes passes through and compares the elements of the array, certain values “bubble” toward the end of the array with each pass
selection sort
sort algorithm that works like this: The smallest value in the array is located and moved to element 0. Then, the next smallest value is located and moved to element 1. This process continues until all of the elements have been placed in their proper order.
insertion sort
sort algorithm that sorts the first two elements, which become the sorted part of the array. It then inserts each of the remaining elements, one at a time, into the sorted part of the array at the correct location
binary search
search algorithm that locates an item in an array by repeatedly dividing the array in half.
ASCII
When sorting an array of string values, the comparisons are made on the basis of the ________ values of the array elements.
once
In the bubble sort algorithm, the inner loop iterates ________ for each of the unsorted array elements.
two
In a selection sort, to change from ascending to descending order, only ________ modifications need to be made to the algorithm.
temporary
To successfully swap the contents of two variables, we need a third variable that can serve as a ________ storage location.