Quiz #4 Review Flashcards

1
Q

For every node in PostOrder traversal:

A

Visit left
Visit right
print

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

For every node in PreOrder traversal:

A

Print
Visit left
Visit Right

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

For every node in InOrder traversal:

A

Visit left
Print
Visit Right

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

key of PostOrder traversal:

A

root always prints last

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

key of InOrder traversal:

A

least to greatest

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

key of PreOrder traversal:

A

root always prints first

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

BST benefit

A

they have speedy searches since all data is ordered properly around the root

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

BST speed

A

Log2(n)

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

Size =

A

of elements = n

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

Leaves:

A

Elements with no kids

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

Edges:

A

non-null links

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

Edges formula:

A

n-1

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

of null links formula:

A

n+1

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

of null links:

A

Node has no leaf

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

Height:

A

longest path from node to length

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

Max size formula:

A

2^(n+1) - 1

17
Q

T/F: Not all BTs are BSTs

A

True

18
Q

Full Tree:

A

at max capacity for specified height

19
Q

Completed Tree:

A

Full to next to last level and filled in from left to right on bottom level

20
Q

Balanced Tree:

A

balanced or not

21
Q

T/F: All full trees are complete trees

A

True

22
Q

What is the fewest amount of leaves a BST can have

A

1

23
Q

BST:

A

All nodes fulfill the property of all values less than the root go to the left and all values greater then the root go to the right

24
Q

Binary Tree:

A

each node has references to two children, however one may be null

25
Q

Removing a node with no children:

A

Set node to null

26
Q

Removing a node with one child:

A

reroute child to parent

27
Q

Removing a node with two children:

A

Bring up its successor (smallest on right) or its predecessor (largest on left)
choose which will keep balance

28
Q

T/F: TreeMap ignores duplicates

A

False

29
Q

Iterator:

A

High level pointer

30
Q

Thread:

A

Path followed when running a program