Fichas
Sequential Search and Selection Sort
Fichas del conjunto (15)
- 1Algorithm AttributesCorrectness
Efficiency
Ease of Understanding
Elegance - 2Algorithm EfficiencyAn algorithms' use of time and space
- 3BenchmarkingTiming an algorithm on a standard data set
- 4Two primary algorithmsSearching algorithm
Sorting algorithm - 5Searching algorithmTask of finding a specific value in a list of values or deciding it's not there
- 6Sorting algorithmsTask of putting a list of values into numeric or alphabetical order
- 7Sequential Search (Linear Search)List DOES NOT need to be sorted
3 scenarios:
Best Case Scenario
Worse Case Scenario
Average Case Scenario - 8Sequential Search: Best Case ScenarioOnly have to process 1 item
- 9Sequential Search: Worse Case ScenarioHave to process every item
N for N items - 10Sequential Search: Average Case ScenarioN/2 for N items
- 11Selection SortFind the largest value in the unsorted part of the list
Swap value from STEP 1 with the last value in the unsorted part of list
Repeat STEPS 1 AND 2 until there is one value remaining in the unsorted part of list - 12How do you find the number of passes in an algorithm?N-1
- 13How do you find the number of swaps in an algorithm?N-1
- 14How do you find the number of exchanges in an algorithm?N
- 15How do you find the number of comparisons in an algorithm?N(n-1)/2
Información
- Descripción
- Fichas sobre Sequential Search and Selection Sort , creado por Amar Malik el 16/09/2019.
- Creado por
- Amar Malik
- Visitas
- 0
- Valoración