Deck 11: Trees

Full screen (f)
exit full mode
Question
Is the code Is the code  <div style=padding-top: 35px>
Use Space or
up arrow
down arrow
to flip the card.
Question
Use a depth-first search to find a spanning tree of the following graph. Start at the vertex a, and use alphabetical order. Use a depth-first search to find a spanning tree of the following graph. Start at the vertex a, and use alphabetical order.  <div style=padding-top: 35px>
Question
Find a minimum spanning tree in the following weighted graph using Prim's algorithm. Find a minimum spanning tree in the following weighted graph using Prim's algorithm.  <div style=padding-top: 35px>
Question
Construct an expression tree for Construct an expression tree for   and write this expression is prefix form and postfix form.<div style=padding-top: 35px> and write this expression is prefix form and postfix form.
Question
(a) Suppose that a full 3-ary tree has 100 internal vertices. How many leaves does it have? (b) Suppose that a full 4-ary tree has 100 leaves. How many internal vertices does it have?
Question
Form a binary search tree from the words of the sentence This test is not so difficult, using alphabetical order, inserting words in the order they appear in the sentence.
Question
Perform a preorder, inorder, and postorder traversal of the rooted tree below. Perform a preorder, inorder, and postorder traversal of the rooted tree below.  <div style=padding-top: 35px>
Question
Use Prim's algorithm to find a minimum spanning tree for the following weighted graph. Use alphabetical
Question
Which of the following graphs are trees ? Explain your answers.
Which of the following graphs are trees ? Explain your answers.  <div style=padding-top: 35px>
Question
A tree has 99 edges. How many vertices does it have?
Question
Use backtracking to find a sum of integers in the set {18, 19, 23, 25, 31} that equals 44.
Question
How many nonisomorphic trees are there with four vertices? Draw them.
Question
Is the code A: 111, B: 101, C: 011, D: 010, E: 10, F: 1101 a prefix code?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/13
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 11: Trees
1
Is the code Is the code
This is a prefix code since the code for A, 11, does not start the code for B or the code for C; the code for B, 10, does not start the code for A or the code for C; and the code for C, 0, does not start the code for A or the code for B.
2
Use a depth-first search to find a spanning tree of the following graph. Start at the vertex a, and use alphabetical order. Use a depth-first search to find a spanning tree of the following graph. Start at the vertex a, and use alphabetical order.
The edges produced by a depth-first search are The edges produced by a depth-first search are   and {b, g}. and {b, g}.
3
Find a minimum spanning tree in the following weighted graph using Prim's algorithm. Find a minimum spanning tree in the following weighted graph using Prim's algorithm.
Prim's algorithm adds the edges {d, e} of weight 1, {e, h} of weight 1, {e, f} of weight 2, {d, g} of weight 3, {g, a} of weight 2, {a, b} of weight 2, {b, c} of weight 3, and {c, i} of weight 3. The total weight of the minimum spanning tree is 17.
4
Construct an expression tree for Construct an expression tree for   and write this expression is prefix form and postfix form. and write this expression is prefix form and postfix form.
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
5
(a) Suppose that a full 3-ary tree has 100 internal vertices. How many leaves does it have? (b) Suppose that a full 4-ary tree has 100 leaves. How many internal vertices does it have?
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
6
Form a binary search tree from the words of the sentence This test is not so difficult, using alphabetical order, inserting words in the order they appear in the sentence.
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
7
Perform a preorder, inorder, and postorder traversal of the rooted tree below. Perform a preorder, inorder, and postorder traversal of the rooted tree below.
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
8
Use Prim's algorithm to find a minimum spanning tree for the following weighted graph. Use alphabetical
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
9
Which of the following graphs are trees ? Explain your answers.
Which of the following graphs are trees ? Explain your answers.
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
10
A tree has 99 edges. How many vertices does it have?
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
11
Use backtracking to find a sum of integers in the set {18, 19, 23, 25, 31} that equals 44.
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
12
How many nonisomorphic trees are there with four vertices? Draw them.
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
13
Is the code A: 111, B: 101, C: 011, D: 010, E: 10, F: 1101 a prefix code?
Unlock Deck
Unlock for access to all 13 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 13 flashcards in this deck.