Can’t find an answer?

Can’t find an answer?

Ask us to get the answer

  • This forum is empty.

What is the time complexity of Huffman Coding?
(A) O(N)
(B) O(NlogN)
(C) O(N(logN)^2)
(D) O(N^2)

Which of the following is true about Kruskal and Prim MST algorithms? Assume that Prim is implemented for adjacency list representation using Binary Heap and Kruskal is implemented using union by rank.
(A) Worst case time complexity of both algorithms is same.
(B) Worst case time complexity of Kruskal is better than Prim
(C) Worst case time complexity of Prim is better than Kruskal

Which of the following is true about Huffman Coding.
(A) Huffman coding may become lossy in some cases
(B) Huffman Codes may not be optimal lossless codes in some cases
(C) In Huffman coding, no code is prefix of any other code.
(D) All of the above

Suppose we run Dijkstra’s single source shortest-path algorithm on the following edge weighted directed graph with vertex P as the source. In what order do the nodes get included into the set of vertices for which the shortest path distances are finalized? (GATE CS 2004)

gate2004
(A) P, Q, R, S, T, U
(B) P, Q, R, U, S, T
(C) P, Q, R, U, T, S
(D) P, Q, T, R, U, S

Traversal of a graph is different from tree because
(A) There can be a loop in graph so we must maintain a visited flag for every vertex
(B) DFS of a graph uses stack, but inorrder traversal of a tree is recursive
(C) BFS of a graph uses queue, but a time efficient BFS of a tree is recursive.
(D) All of the above

What are the appropriate data structures for following algorithms?

1) Breadth First Search 2) Depth First Search 3) Prim's Minimum Spanning Tree 4) Kruskal' Minimum Spanning Tree 

(A)

1) Stack2) Queue3) Priority Queue4) Union Find

(B)

1) Queue2) Stack3) Priority Queue4) Union Find

(C)

1) Stack2) Queue3) Union Find4) Priority Queue 

(D)

1) Priority Queue2) Queue3) Stack4) Union Find

If the DFS finishing time f[u] > f[v] for two vertices u and v in a directed graph G, and u and v are in the same DFS tree in the DFS forest, then u is an ancestor of v in the depth first tree. (Source http://courses.csail.mit.edu/6.006/oldquizzes/solutions/q2-f2007-sol.pdf)
(A) True
(B) False

Which of the following algorithms can be used to most efficiently determine the presence of a cycle in a given graph ?
(A) Depth First Search
(B) Breadth First Search
(C) Prim’s Minimum Spanning Tree Algorithm
(D) Kruskal’ Minimum Spanning Tree Algorithm

The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the nodes of the following graph is


(A) MNOPQR
(B) NQMPOR
(C) QMNPRO
(D) QMNPOR

Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij in the matrix W below is the weight of the edge {i, j}. What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the tree T? (GATE CS 2010)

2010

(A) 7
(B) 8
(C) 9
(D) 10

Viewing 15 topics - 61 through 75 (of 95 total)

1 2 3 4 5 6 7
  • You must be logged in to create new topics.