Decision 1&2 definitions Flashcards

1
Q

What is an algorithm?

A

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

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

What do the different boxes in flow charts represent?

A

Oval : Start/ end
Rectangle: Instruction
Diamond: Decision

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

What is a trace table?

A

A table the keeps track of the step at which you are at and the value of all variables at that step as the algorithm is run

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

What is a bubble sort?

A

A type of sorting algorithm where adjecent items in alist are swapped if they are not in order until the list is sorted.

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

What is a working list?

A

A list where all comparisons are made

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

Whats is a sorted list?

A

A list containg all items that are in their final position

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

What is a quick sort?

A

A sorting algorithm where:
* You select a pivot then split the items into two sublists
* One sublist contains items less than the pivot
* The other sublist contains items greater than the pivot
* You then select further pivots from within each sublist and repeat the process

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

How does the first-fit algorithm work?

A

Works by considering items in the order they are given.
* Take the items in the given order
* Place each item in the first available bin that can take it.Start from bin 1 each time

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

What is the lower bound for the number of bins needed?

A

An optimal solution (uses the least amount of bins) that cannot be improved upon.

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

How does the first-fit decreasing algorithm work?

A

Requires the item to be in descending order before applying the algorithm.
* Sort items in descending order
* Apply firt-fit algorithm to reordered list

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

How does the full-bin packing algoritm work?

A

Uses inspection to select items that will combine to fill bins.Remaining items are packed using first-fit algorithm.
* Uses observation to find combinations of items that will fill a bin.Pack these items firts.
* Any remaining items are packed using the first-fit algorithm.

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

Advatages and disadvatages of first-fit

A

Adv: Quick to implement
Dis: It is not likely to lead to a good solution

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

Advatages and disadvatages of first-fit decreasing

A

Adv: You usually get a fairly good solution. Easy to implement.
Dis: You may not get optimal solution

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

Advatages and disadvatages of full-bin

A

Adv: Usually get good solution
Dis: Difficult to do, especially when the numbers are plentiful and awkward

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

What is the order of an algorithm?

A

Tells you how the changes in the size of a problem affect the approximate time taken for its completion. Can be described as a function of its size

17
Q

What is a graph?

A

Consists of points(vertices or nodes) which are connected by lines (edges or arcs)

18
Q

What is a weighted graph/network?

A

A graph that has a number associated with each edge

19
Q

What is the vertex set of a graph?

A

List of all nodes

20
Q

What is an edge set of a graph?

A

List of all edges

21
Q

What is a subgraph?

A

Part of the original graph. A graph each of whose vertices and edges belong to the original graph

22
Q

What is meant by the degree ( or valency or order) of a vertex?

A

Number of edges incident to it

23
Q

What is a walk?

A

A route through a graph along edges from one vertex to the next

24
Q

What is a path?

A

A walk in which no vertex is visited more than once.

25
Q

What is a trail?

A

A walk in which no edge is visited more than once.

26
Q

What is a cycle?

A

A walk where the start vertex is the same as the end vertex and no other vertex is visited more than once.

27
Q

What is a Hamiltonian cycle?

A

A cycle that includes every vertex

28
Q

What is a connected graph?

A

Two vertices are conncted if there is a path between them. A graph is connected if all vertices are connected

29
Q

What is a loop?

A

An edge that starts and finishes at the same vertex

30
Q

What is a simple graph?

A

Graph with no loops and at most one edge connecting any pair of vertices

31
Q

What is a digraph?

A

A graph where the edges have directions associated with them

32
Q

What is Euler’s Handhshaking lemma?

A

In any undirected graph, the sum of dgrees of the vertices is equal to 2x the number of edges. As a consequence, the number of odd nodes must be even.

33
Q

What is a tree?

A

A connected graph with no cycles

34
Q

What is a spanning tree?

A

Subgraph that includes all vertices of original graph and is also a tree

35
Q

What is a complete graph?

A

A graph in which every vertex is directly connected by a single edge to each of the other vertices

36
Q

What is an isomorphic graph?

A

Show the same information but are drawn differently

37
Q

What is an adjecency matrix?

A

A matrix where each entry describes the number of edges joining corresponding vertices

38
Q

What is a distance matrix?

A

A matrix where each entry represents the weight of the edges joining corresponding values.

39
Q

What is a planar graph?

A

A graph that can be drawn in a plane such as that no two edges meet except at a vertex.