Deck 11: Trees
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/97
Play
Full screen (f)
Deck 11: Trees
1
There are full binary trees with six vertices.
0.
2
If T is a full binary tree with 50 internal vertices, then T has vertices.
101.
3
There are non-isomorphic rooted trees with four vertices.
4.
4
If T is a binary tree with 100 vertices, its minimum height is .
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
5
The bubble sort has complexity 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
6
The minimum number of weighings with a pan balance scale needed to guarantee that you find the single
counterfeit coin and determine whether it is heavier or lighter than the other coins in a group of five coins is
.
counterfeit coin and determine whether it is heavier or lighter than the other coins in a group of five coins is
.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
7
If T is a full binary tree with 101 vertices, its minimum height is .
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
8
If T is a tree with 999 vertices, then T has edges.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
9
If each edge of 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
10
The best comparison-based sorting algorithms for a list of n items have complexity 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
11
There are non-isomorphic trees with four vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
12
Write
in prefix notation: 


Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
13
Every 3-ary tree with 13 vertices has leaves.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
14
Every full binary tree with 50 leaves has vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
15
If T is a full binary tree with 101 vertices, its maximum height is .
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
16
If T is a full binary tree with 50 leaves, its minimum height is .
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
17
The value of the arithmetic expression whose prefix representation is 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
18
C7 has,
spanning trees.

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
19
If T is a full binary tree of height h, then the minimum number of leaves in T is and the maximum
number of leaves in T is .
number of leaves in T is .
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
20
Every full binary tree with 61 vertices has leaves.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
21
mark the statement TRUE or FALSE.
Every tree is planar.
Every tree is planar.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
22
There are full 3-ary trees with 6 vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
23
Prove that if T is a full m-ary tree with l leaves, then T has (ml − 1)/(m − 1) vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
24
Every full 3-ary tree of height 2 has at least vertices and at most vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
25
mark the statement TRUE or FALSE.
If T is a tree with 50 vertices, the largest degree that any vertex can have is 49.
If T is a tree with 50 vertices, the largest degree that any vertex can have is 49.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
26
A full 3-ary tree with 13 internal vertices has vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
27
If T is a tree, then its vertex-chromatic number is and its region-chromatic number is .
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
28
Suppose T is a full m-ary tree with i internal vertices. Prove that T has 1 + (m − 1)i leaves.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
29
The largest number of leaves in a binary tree of height 5 is .
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
30
mark the statement TRUE or FALSE.
There is a tree with degrees 3, 3, 2, 2, 1, 1, 1, 1.
There is a tree with degrees 3, 3, 2, 2, 1, 1, 1, 1.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
31
Draw all nonisomorphic trees with 5 vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
32
mark the statement TRUE or FALSE.
In a binary tree with 16 vertices, there must be a path of length 4.
In a binary tree with 16 vertices, there must be a path of length 4.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
33
mark the statement TRUE or FALSE.
No tree has a Hamilton path.
No tree has a Hamilton path.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
34
mark the statement TRUE or FALSE.
If T is a tree with 17 vertices, then there is a simple path in T of length 17.
If T is a tree with 17 vertices, then there is a simple path in T of length 17.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
35
mark the statement TRUE or FALSE.
There is a tree with degrees 3, 2, 2, 2, 1, 1, 1, 1, 1.
There is a tree with degrees 3, 2, 2, 2, 1, 1, 1, 1, 1.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
36
mark the statement TRUE or FALSE.
Every tree is bipartite.
Every tree is bipartite.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
37
mark the statement TRUE or FALSE.
If T is a rooted binary tree of height 5, then T has at most 25 leaves.
If T is a rooted binary tree of height 5, then T has at most 25 leaves.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
38
Draw all nonisomorphic rooted trees with 4 vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
39
mark the statement TRUE or FALSE.
If two trees have the same number of vertices and the same degrees, then the two trees are isomorphic.
If two trees have the same number of vertices and the same degrees, then the two trees are isomorphic.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
40
Every full binary tree with 45 vertices has internal vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
41
Suppose that the universal address set address of a vertex v in an ordered rooted tree is 3.2.5.1.5. Find
(a) the level of v. (b) the minimum number of siblings of v.
(c) the address of the parent of v. (d) the minimum number of vertices in the tree.
(a) the level of v. (b) the minimum number of siblings of v.
(c) the address of the parent of v. (d) the minimum number of vertices in the tree.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
42
Find the preorder traversal of the parsing tree for 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
43
Find the postorder traversal of the parsing tree for 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
44
Suppose you have 5 coins, one of which is counterfeit (either heavier or lighter than the other four). You use
a pan balance scale to find the bad coin and determine whether it is heavier or lighter.
(a) Prove that 2 weighings are not enough to guarantee that you find the bad coin and determine whether it
is heavier or lighter.
(b) Draw a decision tree for weighing the coins to determine the bad coin (and whether it is heavier or lighter)
in the minimum number of weighings.
a pan balance scale to find the bad coin and determine whether it is heavier or lighter.
(a) Prove that 2 weighings are not enough to guarantee that you find the bad coin and determine whether it
is heavier or lighter.
(b) Draw a decision tree for weighing the coins to determine the bad coin (and whether it is heavier or lighter)
in the minimum number of weighings.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
45
refer to the tree at the right.
Find the inorder traversal.
Find the inorder traversal.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
46
Draw a parsing tree for 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
47
(a) Set up a binary tree for the following list, in the given order, using alphabetical ordering: STOP, LET, THERE, TAPE, NONE, YOU, ANT, NINE, OAT, NUT.
(b) Explain step by step how you would search for the word TEST in your tree.
(c) What is the height of the shortest binary search tree that can hold all 10 words?
(d) Write the preorder traversal of the tree.
(e) Write the postorder traversal of the tree.
(f) Write the inorder traversal of the tree.
(b) Explain step by step how you would search for the word TEST in your tree.
(c) What is the height of the shortest binary search tree that can hold all 10 words?
(d) Write the preorder traversal of the tree.
(e) Write the postorder traversal of the tree.
(f) Write the inorder traversal of the tree.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
48
Write the compound proposition 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
49
Suppose you have 5 coins, one of which is heavier than the other four. Draw the decision tree for using a pan
balance scale to find the heavy coin.
balance scale to find the heavy coin.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
50
The algebraic expression
is written in prefix notation. Write the expression in postfix
notation.

notation.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
51
Find the preorder traversal. 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
52
refer to the tree at the right.
Find the postorder traversal.
Find the postorder traversal.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
53
Find the inorder traversal of the parsing tree for 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
54
Suppose you have 50 coins, one of which is counterfeit (either heavier or lighter than the others). You use a
pan balance scale to find the bad coin. Prove that 4 weighings are not enough to guarantee that you find the
bad coin and determine whether it is heavier or lighter than the other coins.
pan balance scale to find the bad coin. Prove that 4 weighings are not enough to guarantee that you find the
bad coin and determine whether it is heavier or lighter than the other coins.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
55
Write the compound proposition 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
56
Suppose T is a full m-ary tree with l leaves. Prove that T has (l − 1)/(m − 1) internal vertices.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
57
(a) Set up a binary tree for the following list, in the given order, using alphabetical ordering: SHE, SELLS, SEA, SHELLS, BY, THE, SEASHORE.
(b) How many comparisons with words in the tree are needed to determine if the word SHARK is in the tree?
(c) How many comparisons with words in the tree are needed to determine if the word SEAWEED is in the tree?
(d) How many comparisons with words in the tree are needed to determine if the word SHELLS is in the tree?
(b) How many comparisons with words in the tree are needed to determine if the word SHARK is in the tree?
(c) How many comparisons with words in the tree are needed to determine if the word SEAWEED is in the tree?
(d) How many comparisons with words in the tree are needed to determine if the word SHELLS is in the tree?
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
58
Write the compound proposition 

Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
59
The string
is postfix notation for an algebraic expression. Write the expression in prefix
notation.

notation.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
60
Prove that if T is a full m-ary tree with v vertices, then T has ((m − 1)v + 1)/m leaves.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
61
refer to this graph. 
Using alphabetical ordering, find a spanning tree for this graph by using a depth-first search.

Using alphabetical ordering, find a spanning tree for this graph by using a depth-first search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
62
refer to this graph. 
Using reverse alphabetical ordering, find a spanning tree for the graph by using a depth-first search.

Using reverse alphabetical ordering, find a spanning tree for the graph by using a depth-first search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
63
The string
is postfix notation for a logic expression; however, there is a misprint. The
triangle should be one of these three:
Determine which of these three it must be and explain your
reasoning.

triangle should be one of these three:

reasoning.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
64
refer to this graph. 
Using reverse alphabetical ordering, find a spanning tree for the graph by using a depth-first search.

Using reverse alphabetical ordering, find a spanning tree for the graph by using a depth-first search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
65
refer to this graph. 
Using reverse alphabetical ordering, find a spanning tree for the graph by using a breadth-first search.

Using reverse alphabetical ordering, find a spanning tree for the graph by using a breadth-first search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
66
refer to this graph. 
Using the ordering C, D, E, F, G, H, I, J, A, B, C, find a spanning tree for this graph by using a breadth-first
search.

Using the ordering C, D, E, F, G, H, I, J, A, B, C, find a spanning tree for this graph by using a breadth-first
search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
67
refer to this graph. 
Using the ordering B, G, J, A, C, I, F, H, D, E, find a spanning tree for this graph by using a depth-first
search.

Using the ordering B, G, J, A, C, I, F, H, D, E, find a spanning tree for this graph by using a depth-first
search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
68
refer to this graph. 
Using alphabetical ordering, find a spanning tree for this graph by using a breadth-first search.

Using alphabetical ordering, find a spanning tree for this graph by using a breadth-first search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
69
The string
is postfix notation for an algebraic expression. Write the expression in infix
notation.

notation.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
70
refer to this graph. 
Using alphabetical ordering, find a spanning tree for this graph by using a depth-first search.

Using alphabetical ordering, find a spanning tree for this graph by using a depth-first search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
71
The string
is prefix notation for an algebraic expression. Write the expression in infix
notation.

notation.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
72
refer to this graph. 
Using alphabetical ordering, find a spanning tree for this graph by using a breadth-first search.

Using alphabetical ordering, find a spanning tree for this graph by using a breadth-first search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
73
refer to this graph. 
Using the ordering C, D, E, F, G, H, I, J, A, B, C, find a spanning tree for this graph by using a depth-first
search.

Using the ordering C, D, E, F, G, H, I, J, A, B, C, find a spanning tree for this graph by using a depth-first
search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
74
The string
is prefix notation for an algebraic expression. Write the expression in postfix
notation.

notation.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
75
refer to this graph. 
Using the ordering C, D, E, F, G, H, I, J, A, B, C, find a spanning tree for this graph by using a depth-first
search.

Using the ordering C, D, E, F, G, H, I, J, A, B, C, find a spanning tree for this graph by using a depth-first
search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
76
refer to this graph. 
Using the ordering B, G, J, A, C, I, F, H, D, E, find a spanning tree for this graph by using a breadth-first
search.

Using the ordering B, G, J, A, C, I, F, H, D, E, find a spanning tree for this graph by using a breadth-first
search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
77
refer to this graph. 
Using reverse alphabetical ordering, find a spanning tree for the graph by using a breadth-first search.

Using reverse alphabetical ordering, find a spanning tree for the graph by using a breadth-first search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
78
refer to this graph. 
Using the ordering B, G, J, A, C, I, F, H, D, E, find a spanning tree for this graph by using a depth-first
search.

Using the ordering B, G, J, A, C, I, F, H, D, E, find a spanning tree for this graph by using a depth-first
search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
79
refer to this graph. 
Using the ordering C, D, E, F, G, H, I, J, A, B, C, find a spanning tree for this graph by using a breadth-first
search.

Using the ordering C, D, E, F, G, H, I, J, A, B, C, find a spanning tree for this graph by using a breadth-first
search.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
80
Find the value of
(in prefix notation) if 


Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck