Algorithms Flashcards

1
Q

What are the components of an algorithm?

A
  • finite number of steps
  • unambigious steps
  • deterministic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is complexity ?

A
  • Size in relation to run time (efficiency )
  • measure of which one is faster
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Perform a quick sort algorithm to sort it into ascending order

A

values less than or equal to go to the left of pivot

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

what is
* first fit
* first fit decreasing
* full bin

A
  • FF: putting the numbers using given order in question
  • FFD: ordering the list into descending order - biggest first
  • FB: using brain for optimal solution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what does heuristic mean?

A
  • a method that finds the solution efficently, but with no gurante that this solution is optimal
  • important when classical methods fail, only way to find is exhauting all solutions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how can the efficency of different packing methods be tested?

A

counting the number of comparisions needed in worst case

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

what is the complexit of the first fit and first fit decreasing algorithm , in the worst case?

A

o (n sqaured)

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

what is the complexity of the quick sort algorithm , in the worst case?

A

O (n squared)

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

What is big O notation?

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

Use quick sort to sort the following numbers in descending order

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

Use quick sort to sort the following numbers in descending order

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