Algorithms Flashcards

1
Q

What is an algorithm?

A

An algorithm describes a sequence of steps to solve a computational problem or perform a calculation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is Algorithm efficiency typically measured?

A

Algorithm efficiency is typically measured by the algorithm’s computational complexity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Computational complexity?

A

Computational complexity is the amount of resources used by the algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is runtime complexity?

A

An algorithm’s runtime complexity is a function, T(N), that represents the number of constant time operations performed by the algorithm on an input of size N.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an algorithm’s worst case?

A

An algorithm’s worst case is the scenario where the algorithm does the maximum possible number of operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an algorithm’s best case?

A

An algorithm’s best case is the scenario where the algorithm does the minimum possible number of operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe what a Linear search algorithm does.

A

Linear search is a search algorithm that starts from the beginning of a list, and checks each element until the search key is found or the end of the list is reached.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is algorithm runtime?

A

An algorithm’s runtime is the time the algorithm takes to execute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Big O notation?

A

Big O notation is a mathematical way of describing how a function (running time, or runtime, of an algorithm) behaves in relation to the input size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the worst-case runtime?

A

The worst-case runtime of an algorithm is the runtime complexity for an input that results in the longest execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the selection sort algorithm?

A

Selection sort is a sorting algorithm that treats the input as two parts, sorted and unsorted, and repeatedly selects the proper next value to move from the unsorted part to the end of the sorted part.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the Insertion sort algorithm?

A

Insertion sort is a sorting algorithm that treats the input as two parts, sorted and unsorted, and repeatedly inserts the next value from the unsorted part into the correct location in the sorted part.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the Quicksort algorithm?

A

Quicksort is a sorting algorithm that repeatedly partitions the input into low and high parts (each unsorted), and then recursively sorts each of those parts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the Merge sort algorithm?

A

Merge sort is a sorting algorithm that divides a list into two halves, recursively sorts each half, and then merges the sorted halves to produce a sorted list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Shell sort algorithm?

A

Shell sort is a sorting algorithm that treats the input as a collection of interleaved lists, and sorts each list individually with a variant of the insertion sort algorithm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is radix sort algorithm?

A

The radix sort algorithm sorts a list of integers by grouping elements based on the element’s digits, starting with the least significant digit and ending with the most significant.

17
Q

What is a heuristic?

A

Heuristic: A technique that willingly accepts a non-optimal or less accurate solution in order to improve execution speed.

18
Q

What is a self-adjusting heuristic algorithm?

A

A self-adjusting heuristic is an algorithm that modifies a data structure based on how that data structure is used.

19
Q

What is a greedy algorithm?

A

A greedy algorithm is an algorithm that, when presented with a list of options, chooses the option that is optimal at that point in time.