Search and Sort(Week 5)

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Bubble Sort

A simple (and relatively slow) sorting algorithm that repeatedly loops through a list of values, comparing adjacent values and swapping them if they are in the wrong order.

Sort

An algorithm used to arrange elements of an array into natural order, such as numeric or alphabetical.

Insertion Sort

Best for checking if a list is already in sorted order. Uses a nested loop process. There is no Swap. A type of sort that uses a nested loop process to systematically find the best place in the current array for an unsorted item. Looks at the number on the left and see if it is bigger. If it is bigger, shift all the values to the right to fit the number.

Merge Sort

Divide and half, merging the halves back together. Divide until you get a single variable, then put back into order. Once the two orders are sorted, combine the halves. Uses twice as much memory to store a temp storage array.

Selection Sort

Find the best value for the position. A sorting routine that uses a nested loop process to systematically select the best value along the unsorted elements of the array for the next position in the array, starting with position zero all the way to the end.

Swap

The process in sort routines of exchanging two values in an array, using a temporary variable, taking three steps to execute.

Binary Search

The process of searching through an ordered set of data using the divide and conquerer technique.

Quick Sort

Uses divide and conquer method in effective way. The middle values is a pivot. Compare the numbers to the pivot; move the lesser values to the left and the great values to the right.

Linear Search

You look through the entire list until you find the item. A loop based search process using an array of values that starts looking at the first of the list and continues towards the end of the list until the target is found, or until the end of the array is reached.


Kaugnay na mga set ng pag-aaral

Saunders Ch.60: Musculoskeletal Problems w/ Rationale

View Set

Cell structure and division key term matching

View Set

Microeconomics - Practice Test 03: Supply and Demand

View Set

Be able to explain the apologetic proof-text of 1 Peter 3:15 and its relation to 1 Corinthians 2:1-5.

View Set

AP Statistics Unit 2 Vocab Review

View Set

Moon Phases and Eclipses: HC 6th grade science

View Set