Unit 1 - Section 3 Flashcards

1
Q

Efficiency

A

the term used to describe an algorithm’s careful use of resources

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

Analysis of algorithms

A

the study of the efficiency of algorithms

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

Sequential Search

A

n/2 - not sufficiently time efficient for large values of n

** it is space efficient as it does not use more memory than the original input requires

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

O(n)

A

anything that varies as a constant times n ( and whose graph follows the basic shape of n)

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

Selection Sort algorithm

A

” grows” a sorted subsection of the list from back to the front.

(n-1/2) n

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

Order n²

A

The number of comparisons done by the selection sort algorithm grows at approximately the square of the problem size n²

An algorithm that does cn² work for any constant c is order of magnitude n² or O(n²)

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

Floating-point operations

A

Arithmetic operations such as additions and subtractions of real numbers

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

Data Clean-up Algorithms

A

Shuffle-left algorithm
Copy-Over algorithm
Converging-Pointers Algorithm

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

Binary Search

A

Only works on sorted lists
The number of times a number n can be cut in half and not go below 1 is called the logarithm of n to the base 2, which is abbreviated lgn ( also written log 2 n )
In general lgn = m is equivalent to 2 to the power of m = n
It is also space efficient as it requires only a small amount of additional storage to keep track of beginning, end and midpoint positions.

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

Algorithms of order of magnitude lgn

A

O(lgn) are like various modes of flying.

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

Pattern Matching

A

Usually involves a pattern lenght that is short compared with the text length, that is, when m is much less than n. In such cases, n-m+1 is essentially n.

The pattern matching algorithm is therefore 0(n) in the best case and 0(mxn) in the worst case.

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

Algorithms 0(lgn), O(n), and O(n²) are polynomialy bounded

A

in the amount of work they do as n increases

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

A collection of nodes and connecting edges is

A

called a graph

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

Hamiltonian Circuit

A

A path through a graph that begins and ends at the same node and goes through all other nodes exactly once

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

An O(2ⁿ) algorithm is called

A

an exponential algorithm

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

brute force algorithm

A

one that beats the problem into submission by trying all possibilities

17
Q

Problems for which no polynomially bounded algorithm exists are

A

called intractable

18
Q

Approximation algorithms

A

These algorithms don’t solve the problem but they provide a close approximation to a solution.