Searching and Sorting Algorithms

Description

Flashcards on Searching and Sorting Algorithms, created by yo uo on 24/06/2018.
yo uo
Flashcards by yo uo, updated more than 1 year ago More Less
Josh Calvert
Created by Josh Calvert almost 8 years ago
Arnav Kolhe
Copied by Arnav Kolhe almost 8 years ago
yo uo
Copied by yo uo over 6 years ago
0
0

Resource summary

Question Answer
Which search/sorting algorithm is this pseudo-code from and what is its function? while left <= right and array[left] <= p left = left + 1 Quick Sort Until the left check value crosses the right check value or the left check value is less than the pivot, keep checking
Which search/sorting algorithm is this pseudo-code from and what is its function? while pos > 0 and array[position - 1] > val array[pos] = array[pos - 1] pos = pos - 1 Insertion Sort Starting at the highest position, until the value being checked is less than the number above it or is the lowest number, check the next value
Which search/sorting algorithm is this pseudo-code from and what is its function? if array[midpoint] < item first = midpoint + 1 else last = midpoint - 1 Binary Search If the search value is greater than the mid value of the list, repeat between the mid index + 1 and last. Otherwise, repeat between the mid index - 1 and first
Which search/sorting algorithm is this pseudo-code from and what is its function? if right < left flag = true else temp = array[left] array[left] = array[right] array[right] = temp Quick Sort If the left and right markers have crossed, the array is sorted. Otherwise, swap the values at the left and right markers
Which search/sorting algorithm is this pseudo-code from and what is its function? temp = array[i] array[i] = array[i + 1] array[i + 1] = temp Bubble Sort Swap the value in position "i" with the value in position "i + 1"
Which search/sorting algorithm is this pseudo-code from and what is its function? while i = 0 < arraylength - 1 and flag = true flag = false for j = 0 to arraylength - i - 2 Bubble Sort Until a whole pass of the list is complete or the list is sorted, assume the list isn't sorted and cycle through all numbers that haven't been checked this pass
Which search/sorting algorithm is this pseudo-code from and what is its function? while i = 0 < arraylength and flag = false if array[i] = item flag = true Linear Search Check every value in the list until you find what you want. If you do, flag you found it for use elsewhere
Which search/sorting algorithm is this pseudo-code from and what is its function? left = array[0, mid] right = array[mid, arraylength - 1] run(left) run(right) Merge Sort Split the array into left and right halves, pause execution and run algorithm on left half and then run on right half
Show full summary Hide full summary

Similar

Data Structures & Algorithms
Reuben Caruana
Computer science unit 2
Somto Ibeme
Algorithm Analysis Review
Shannon Anderson-Rush
Algorithms ♡
lauren ♥
Computational Thinking ♡
lauren ♥
Systems Software Revision
cocacolai
Grafy I.
Michal Roch
52. Dopamine makes people addicted to seeking information
davis.caroline51
Grafy I. - selftest
Michal Roch
Mathematical Preliminaries
msladey