Saturday, October 27, 2007

Greedy Strategy Interview Question Part 2


11. Lossless encoding techniques include
i) Run length encoding
ii) Huffman encoding
iii) Transform coding
The correct option is
a. i
b. i and ii
c. all of the above
d. only ii
Ans. b
12. Disjoint sets are __________ sets.
Ans. mutually exclusive/independent
13. The disjoint set is an abstract data type that supports ___________ and _________ operations.
Ans. Union and find
14. Union(x,y) is an operation in disjoint set which means merge the set containing x with the set containing y. (True or False)
Ans. True
15.Find(x) should return some representation of the set containing x. (True or False)
Ans. True
16.Running time of find(i) is proportional to the _________of the tree containing node i.
Ans. height
17. Minimum spanning tree gives shortest distance between
a. any two nodes
b. source and destination
c. source and any node
d. none
Ans. b
In minimum spanning tree,we get the shortest path between the source and the destination.
18. The shortest path algorithm gives minimum distance between
a. any two nodes
b. source and destination
c. all of the above
d. source and any node
Ans. a
19. The cost of a path between two vertices is the sum of the _________ of the edges in that path.
Ans. costs
20. Huffman’s coding technique uses ____________ algorithm.
Ans. Greedy algorithm
21. Huffman coding uses __________
a. tree
b. graph
c. linked list
d. stack
Ans. a
22. The data structure used for the implementation of Kruskal’s algorithm is
a. Graph
b. Linked list
c. stack
d. disjoint set
Ans. d

0 comments:

Advertisement

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com