11.2 Application of Trees Flashcards

1
Q

A binary search tree is a binary tree with the following properties:

A
  • Each vertex has a value called a key.
  • The left subtree of a vertex contains only vertices with keys less than the vertex’s key.
  • The right subtree of a vertex contains only vertices with keys greater than the vertex’s key.
  • The left and right subtree must also be a binary search tree.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A binary search tree is a binary tree with the following properties:

A
  • Each vertex has a value called a key.
  • The left subtree of a vertex contains only vertices with keys less than the vertex’s key.
  • The right subtree of a vertex contains only vertices with keys greater than the vertex’s key.
  • The left and right subtree must also be a binary search tree.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Decision Trees

A

A rooted tree in which each internal vertex corresponds to a decision, with a subtree at these
vertices for each possible outcome of the decision

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

Decision Trees

A

A rooted tree in which each internal vertex corresponds to a decision, with a subtree at these
vertices for each possible outcome of the decision

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

Dec. Tree Theorem 1

A

A sorting algorithm based on binary comparisons requires at least [log n!] comparisons.

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

Dec. Tree Corollary 1

A

The number of comparisons used by a sorting algorithm to sort n elements based on binary comparisons
is Ω(n log n).

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

Dec. Tree Theorem 2

A

The average number of comparisons used by a sorting algorithm to sort n elements based on binary
comparisons is Ω(n log n).

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

Dec. Tree Theorem 2

A

The average number of comparisons used by a sorting algorithm to sort n elements based on binary
comparisons is Ω(n log n).

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

Prefix Codes

A

encode letters so that the bit string for a letter never occurs as the first part of the bit
string for another letter.

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

Prefix Codes

A

encode letters so that the bit string for a letter never occurs as the first part of the bit
string for another letter.

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

Huffman Coding

A

An algorithm that takes as input the frequencies of symbols in a string and produces an output a
prefix code that encodes the string using the fewest possible bits, among all possible binary prefix
codes for these symbols.

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