You can prepare effectively for Computer Science Engineering (CSE) Algorithms with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: Greedy Techniques- 1". These 15 questions have been designed by the experts with the latest curriculum of Computer Science Engineering (CSE) 2026, to help you master the concept.
Test Highlights:
Sign up on EduRev for free to attempt this test and track your preparation progress.
The length of the path from v5 to v6 in the MST of previous question with n = 10 is
Detailed Solution: Question 1
To implement Dijkstra’s shortest path algorithm on unweighted graphs so that it runs in linear time, the data structure to be used is:
Detailed Solution: Question 2
A networking company uses a compression technique to encode the message before transmitting over the network. Suppose the message contains the following characters with their frequency:
character Frequency
a 5
b 9
c 12
d 13
e 16
f 45
Note : Each character in input message takes 1 byte. If the compression technique used is Huffman Coding, how many bits will be saved in the message?
Detailed Solution: Question 3
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?

Detailed Solution: Question 4
Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by Dijstra?s shortest path algorithm? Assume that, in any iteration, the shortest path to a vertex v is updated only when a strictly shorter path to v is discovered.

Detailed Solution: Question 5
Detailed Solution: Question 6
In the graph given in above question question, what is the minimum possible weight of a path P from vertex 1 to vertex 2 in this graph such that P contains at most 3 edges?

Detailed Solution: Question 7
Dijkstra’s single source shortest path algorithm when run from vertex a in the below graph, computes the correct shortest path distance to

Detailed Solution: Question 8
In question #2, which of the following represents the word "dead"?
Detailed Solution: Question 9
An undirected graph G has n nodes. Its adjacency matrix is given by an n × n square matrix whose
(i) diagonal elements are 0‘s and
(ii) non-diagonal elements are 1‘s.
which one of the following is TRUE?
Detailed Solution: Question 10
In an unweighted, undirected connected graph, the shortest path from a node S to every other node is computed most efficiently, in terms of time complexity by
Detailed Solution: Question 11
Detailed Solution: Question 12
Consider the following graph:

Which one of the following cannot be the sequence of edges added, in that order, to a minimum spanning tree using Kruskal’s algorithm?
Detailed Solution: Question 13
In a weighted graph, assume that the shortest path from a source 's' to a destination 't' is correctly calculated using a shortest path algorithm. Is the following statement true? If we increase weight of every edge by 1, the shortest path always remains same.
Detailed Solution: Question 14
Suppose the letters a, b, c, d, e, f have probabilities 1/2, 1/4, 1/8, 1/16, 1/32, 1/32 respectively. Which of the following is the Huffman code for the letter a, b, c, d, e, f?
Detailed Solution: Question 15
81 videos|115 docs|33 tests |