The Order Of An Algorithm Flashcards

1
Q

The efficiency of an algorithm

A

Is a measure of the run-time for the algorithm, often proportional to the number of operations to be executed.

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

The size of an algorithm

A

Is a measure of its complexity

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

The order of an algorithm

A

Is a measure of its efficiency as a function of the size of the problem

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

What’s the efficiency of bubble sorting algorithm as a function

A

1/2(n-1)n

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

What’s the measure of size for any sorting algorithm

A

n

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

Of what order is the bubble sorting algorithm is ?

A

Of quadratic order

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

What is an algorithm

A

It is a set of instructions
It must have a finite number of steps
It must work for any valid input
It must have an end

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

Full bin combinations algorithm explained

A

FInd combination of items that will completely fill a bin

Places remaining items using a first fit algorithm

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

First fit algorithm

A

Places items in the given order to the first available bin

It is a heuristic algorithm meaning it attemps to find the best optimal solution

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

First fit decreasing algorithm

A

Sort items in decreasing order by using another algorithm such as bubble sort or insertion sort and then performs first fit algorithm

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

Which algorithm between a full bin combinations and first fit algorithm produces the best optimal solution?

A

the full bin combinations algorithm

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

What is a graph

A

A graph is a series of nodes (or vertices) connected by edges (or arcs)

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

How to find the degree of a graph

A

To find the degree (or order or valency ) of a vertex count how many ends of edges (or arcs) there are at the vertex

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

Why can’t the order of a connected graph be an odd number?

A

Because in a connected graph it is possible to go from any vertex to the other

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

What is a loop ?

A

A loop is an edge (or arc) that starts and finshes at the same node

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

What is a tree ?

A

A tree is a connected graph with no cycles/loops

17
Q

What is a spanning tree?

A

A spanning tree is a connected subgraph with no cycles/loops containing all vertices (or nodes)

18
Q

How many edges in a tree of 10 nodes

A

9 edges (or arcs) because every node is visited only once

19
Q

Isomorphic graph have

A

the same incidence matrix despite looking visually different

20
Q

What is a network grpah

A

Adding a weight or value to nodes in a graph will produce a weighted grpah( or a network)

21
Q

Planar graph defined

A

A graph where none of the edges are crossed by each other

22
Q

Prim’s algorithm

A

will find the minumum spanning tree
It works by:
select any node to begin with
select the shortest edge connected to that node
select the shortest edge connecting any node that has been already
connected
repeat previous step until all nodes have been connected

23
Q

Kruskal’s algorithm

A

selects the shortest edge in a network
select the next shortest edge which does not create a cycle
repeat previous steps until all nodes are connected

24
Q

Dijkstra’s algorithm

A