4.3 Fundamentals of Algorithims Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the 2 features of a breadth first graph traversal?

A

Shortest path for an unweighted graph
uses a queue

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

What are the 2 features of a depth first graph traversal?

A

Navigating a maze
uses a stack

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

pre order tree traversal order and when its used

A

Root, Left, Right - Copying a tree.

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

post order tree traversa

A

Left, Right, Root -

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

in order tree traversal and when its used (1)

A

Left, Root, Right -
Used in binary search trees

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

What is Meant by O(N)

A

O represents the order of complexity

N represents the number of inputs

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

What are the factors of complexity used in big o notation

A

Memory used, time clompexity

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

Time complexity of linear search

A

O(n)

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

Time complexity of Binary/Binary tree search

A

O(log n).

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

Time complexity of Bubble sort

A

O(n^2).

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

Time complexity of Merge sort

A

O(n log n).

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

What is djikstras algorithim? and the real life applications? (3)

A

Shortest path algorithim

chip design
finding routes from one place to another
web crawlers

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

What does it mean when algorithims are tractable?

A

These are problems that have a polynomial (or less) time solution (x^2)

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

What is it when an algorithim is intractable?

A

These are problems that have solutions in greater than polynomial time

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

What methods are used when tackling intractable problems

A

Heuristic methods

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

How do we trace a graph depth first

A

Start at a root and follow one branch as far as it will go. (using stack)

17
Q

How do we trace a graph breadth-first

A

start at root scan every node connected and then continue scanning from left to right (using queue)

18
Q

What are heuristic methods

give 2 examples

A

practical approaches used when finding an optimal solution is impractical or impossible due to time constraints

For example trial and error, pattern recognition