Greedy Technique: GATE CS Previous Year Questions

Greedy Technique · Algorithms

11 questions · asked in 7 of 27 years (2000–2026)

MCQ 7 · MSQ 1 · NAT 31-mark 6 · 2-mark 5

2000Questions per year2026

Questions 6–10 of 11

Q6GATE 20071 markMCQ−0.33 if wrong
Consider n jobs J1,J2…JnJ_1, J_2 \dots J_n such that job JiJ_i has execution time tit_i and a non-negative integer weight wiw_i. The weighted mean completion time of the jobs is defined to be ∑i=1nwiTi∑i=1nwi\frac{\sum_{i=1}^{n}w_iT_i}{\sum_{i=1}^{n}w_i}, where TiT_i is the completion time of job JiJ_i. Assuming that there is only one processor available, in what order must the jobs be executed in order to minimize the weighted mean completion time of the jobs?

Q7GATE 20071 markMCQ−0.33 if wrong
Suppose the letters a, b, c, d, e, f have probabilities 1/2, 1/4, 1/8, 1/16, 1/32, 1/32 respectively.

What is the average length of the Huffman code for the letters a,b,c,d,e,f?

Q8GATE 20071 markMCQ−0.33 if wrong
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?

Q9GATE 20061 markMCQ−0.33 if wrong
The characters a to h have the set of frequencies based on the first 8 Fibonacci numbers as follows
a:1, b:1, c:2, d:3, e:5, f:8, g:13, h:21
A Huffman code is used to represent the characters. What is the sequence of characters corresponding to the following code?
110111100111010

Q10GATE 20051 markMCQ−0.33 if wrong
We are given 9 tasks T1, T2... T9. The execution of each task requires one unit of time. We can execute one task at a time. Each task Ti has a profit Pi and a deadline di Profit Pi is earned if the task is completed before the end of the dith unit of time.
Task Profit Deadline T1 15 7 T2 20 2 T3 30 5 T4 18 3 T5 18 4 T6 10 5 T7 23 2 T8 16 7 T9 25 3
What is the maximum profit earned?

Keep practising

Topics in Algorithms

All CS topics ›