Definition of an algorithm

¡Supera tus tareas y exámenes ahora con Quizwiz!

5 important characteristics of algorithms

1. are well-ordered 2. have unambiguous operations 3. have computable operations 4. produce a result 5. halt in a finite amount of time

swap algorithm

1. copy the content of the least to the temp 2. copy the content of the greatest to cell b 3. copy the content of the least to cell a

Why algorithms halt in a finite amount of time?

They must stop some time to avoid occupying too much memory >.<

Why do algorithms need to produce results?

algorithms need to be able to produce results for them to be judged whether they produced the right or wrong result

comparison algorithm

compares two contents with each other

Why do algorithms have unambiguous operations?

computer needs to have exact instructions to solve a problem, it cannot solve a problem with ambiguous operations.

Why do algorithms have effectively computable operations?

computers must be able to execute operations that are doable - possible.

Why do algorithms need to be well-ordered?

needs to be well-ordered, computers need to know the exact steps to execute the algorithm.

List all the sorting algorithms

quicksort, merge sort, heapsort, insertion sort, introsort, selection sort, timsort, shell sort, bubble sort, binary tree sort, cycle sort, library sort, patience sorting, smoothsort, strand sort, tournament sort, cocktail sort, comb sort, gnome sort, in-place merge sort, bogosort


Conjuntos de estudio relacionados

Diverticulosis and Diverticulitis

View Set

Mastering A & P Bone tissue, histology and muscle tissue

View Set

MS: Infectious disease 27; Skills/procedures 22; Safety/infection ctrl 11 ; Basic care & comfort/pain mgt 7

View Set

NUR 1023 Module 1 and 2 Exam Review

View Set