intro Flashcards

(16 cards)

1
Q

What is an algorithm?

A

A step-by-step procedure for solving a problem in a finite amount of time.

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

what is a Data structure?

A

A way for data to be organized in computer memory.

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

What is a program?

A

A program is a set of instruction which the computer will follow to solve a problem or perform a computation

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

What types of algorithm efficiency is measured?

A
  • Time: execution time
    Space: memory and disk usage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is linear growth?

A

O(N) = algorithms solve problems very quickly

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

what is quadratic growth?

A

algorithms become impractical for inputs exceeding a few thousand
(grow very quickly)

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

what is cubic growth?

A

algorithms are impractical for input sizes exceeding a few hundred

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

what is big O notation?

A

notation for caputring asymptotic growth rate. Used to capture the most dominant term in a function that eventually will dominate all others to have the most accurate rate of growth.

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

Example of big o?

A

for T(N) = N^2 + N + 3
the big o is O(N^2)

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

What is big omega notation?

A

An optimistic estimate of the time complexity or “best fit”. Will eventually grow at least as fast as the best fit. The element of the equation with the tightest bound to the actual projected answer (think graphically)

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

Example of big omega?

A

for T(N) = N^2 + N + 3
big omega will be N^2 as it will eventually be as quick as N^2

“The slowest rate at which the function grows, for large inputs — ignoring constant and low-order noise”
Ω(N) means the function grows at least as fast as 𝑁. N^2 definitely does that!

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

what is a big theta notation?

A

If “best element” and big O is the same. Same order of growth and is bounded above and below by same value

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

Example of big theta?

A

for T(N) = N^2 + N + 3
theta(N^2) is the answer as it was both the tightest bound and the upper bound.

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

order by growth rate

A

logN<N<NlogN<N^2<2^N

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

thing to remember with big omega?

A

You can always say
Ω(anyslowerfunction)
🚫 But only the dominant term gives you a tight bound.

Any function that grows slower than the dominant term can still be used in Ω, but won’t be tight.

So
T(N)∈Ω(N^2) is the best description even though Ω(N) is also true.

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

rule of thumb for notation?

A

Omega: anything <= dominant term
O: anything >= dominant term
theta: Only dominant term