Chapter 1 Flashcards

1
Q

What is an algorithm?

A

A finite sequence of step by step instructions carried out to solve a problem

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

What shape shows start/end ina flow chart?

A

And oval

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

What shape shows an instruction ina flow chart?

A

Rectangle

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

What shape shows a decision in a flow chart?

A

Diamond

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

Name two types of sort

A

Bubble Sort

Quick sort

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

Describe a bubble Sort

A

Start at the beginning if the lost and compare adjacent items
If they are in order leave them
If they are not in order swap them
When you get to the end of the lost the final item will be in the right place
Repeat the steps until a pass is completed without swaps

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

Describe a Quick Sort

A

The midpoint of the list is the first pivot
Put all the items less than the II it on the left sid and all the ones more on the right side of the pivot
Repeat again with each sub list
When all the items have been pivots stop

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

What are the three bin packing algorithms?

A

First fit
First fit decreasing
Full bin

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

Describe the first fit algorithm

A

Take the items in the order given

Place each item in the first available bin

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

Describe the first fit decreasing algorithm

A

Sort the items into descending order

Apply the first fit algorithm

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

Describe the full bin packing algorithm

A

Use observation to find combinations that will fill a bin and a k these first
Any remaining ones are lacked using first fit

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

If an algorithm has order f(n) what factor will the run time increase by?

A

f(m)/f(n)

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