Algorithims 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 traversal and when its used (2)

A

Left, Right, Root -
Binary search tree
Outputting the contents of a binary search tree in ascending order.

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 (3)

A

Left, Root, Right -
Infix to RPN conversions
Producing a postfix expression from an expression tree
Emptying a tree.

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

Time complexity of linear search

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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
8
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
9
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
10
Q

What is djikstras algorithim? and the applications?

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
11
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
12
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
13
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