Trees intro Flashcards

1
Q

What r the general types of trees?

A
1 - family trees
2 - Decision trees 
3 - expression trees
4 - file system
5 - hirearchy
6 - to express syntax in code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

why are trees important and there are so many of them?

A

1 - dynamic DS

2 - structure conveys information

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

what is the recursive definition of a tree?

A

empty or :
with a node:
which have a key and might have child nodes

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

what is the root?

A

the top node in a tree

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

what is a leaf?

A

a node with no children

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

what is an interior node?

A

a node with a child

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

what is a level?

A

1+ the number of edges between root and node

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

what is the height?

A

maximum depth of subtree node and farthest leaf

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

what is a forest?

A

a collection of trees?

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

what is BFS?

A

it’s breadth first search:

we check all the connections at on time

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

what is DFS?

A

it’s depth first search:

we check only one connection at a time

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

what is the DS for BFS?

A

queue

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

what is the DS for DFS?

A

stack

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