Greedy Algorithms questions

Q5

GATE CS 2017 CS-1Algorithm DesignMCQ1 mark−1/3 if wrong
Consider the following table:
AlgorithmsDesign Paradigms
(P) Kruskal(i) Divide and Conquer
(Q) Quicksort(ii) Greedy
(R) Floyd-Warshall(iii) Dynamic Programming
Match the algorithms to the design paradigms they are based on.
Show answer without attempting

Answer: C

Q50

GATE CS 2017 CS-2Algorithm DesignNAT2 marks
A message is made up entirely of characters from the set X={P,Q,R,S,T}X = \{P, Q, R, S, T\}. The table of probabilities for each of the characters is shown below:
CharacterProbability
P0.22
Q0.34
R0.17
S0.19
T0.08
Total1.00
If a message of 100 characters over XX is encoded using Huffman coding, then the expected length of the encoded message in bits is ____________.
Show answer without attempting

Answer: 225.0

0/20 correct0 marks

Related topics in Algorithm Design