Professional Documents
Culture Documents
MAD Test3
MAD Test3
How many companisons are needed in order to locate the word “lemon” in the binary search tree of the
list mang, banana, apple, pear, coconut, strawberry, lemon?
3
Find the least number of vertices of a full 3 ary tree of height 3
10
5
Which of the following graphs have euler circuits ?
i.K
ii.C20
iii.W
i,ii,iii
Y
Using Prim’s algorithm to find a minimal spanning tree. What is the list of edges chosen?
CE,BC,AB,BD,DZ
Find the least number of a balanced full binary tree of height 10.
513
How many connected components in the graph?
9
What is the position of the letter f when using the postorder traversal?
10
The number of edges in a graph with 7 vertices, 2 of degree 4, 1 of degree 2 and 4 of degree 1, is______
7
Given two undirected graphs with adjacency matrices
C4,8
How many cut verices and cut adges in the graph?
3 and 3
Draw a binary search tree for the sentence ‘the quick brown fox jumps over the lazy dog’
6
Which graphs exist?
Use huffman coding to encode the message “glaciology”.what is the average number of bits required to
encode a charater?
D.2.80
Fun
How many internal vertices does a full 4-ary tree with 34 leaves have?
11
For what values of n does the graph Qn have hamilton circuits?
N>1
40
Which graph are tree?
4
Using prim’s algorithm to find a minimal spanning tree. What is the list of adges chosen?
CE,BC,AB,EZ,DZ
Apply the Dijkstra algorithm to find the shortest path from A to Z. what are the first three verices
chosen?
A.A,B,E
2,2,3,3,4,4
To encode a message in which there are 9 distinct charaters {a,b,c,d,e,f,g,h,i}, we want to use a coding
scheme where the 8 characters a,b,c,d,e,f,g,h,i
for this coding scheme to be a prefix code, which of the following strings can be used for the character
“I”
D. none
13
8 vertices
Which of the following proposition is true:
For which (m,n) does the graph Km,n have hamilton path but no hamilton circuits?
K3,2
What is the height of the spanning tree obtained from the complete bipartite graph K4,3 by depth-first
search, strarting at a vertex of degree 4?
6
C.none
Use huffman coding to encode these symbols with given frequencies
2.25
There are 4 coins among which there is a conterfeit coin that is either heavier or lighter than the other.
With a balance scale. How many weighings are needed to determine the conterfeit coin?
2
Let g be a simple graph whose vertices are of degree 3. If g has 15 edges. How many vertices does g have
10
3
How many internal vertices in a full 3-ary tree with 43 leaves?
21
Given a simple graph g with 8 edges. The complementaru graph of g, denoted by g’. is the graph on the
same vertices. And two vertices are adjacent in g’…… has 2 edges, how many vertices does g have ?
5
For what values of n does the graph W have hamilton circuit?
n>2
*/15 7 + 1 1 3 + 2 + 1 1
5
How many vertices in a full 3-ary tree with 101 How many cut edges does this graph have?
leaves?
151
Are there two graphs isomorphic? If not, what is How many comperisons are needed in order to
the reason? locate/insert the word “SHARK” in the binary
search tree of the list
{SHE, SELLS, SEA, SHELLS, BY, THE, SEASHORE}
W4 13
How many cut vertices does this graph have? which of the following graphs have euler circuit?
i.K5 iiC20 iiiW….
3 I , ii