Skip to content

GATE CS Algorithm Design: Greedy Techniques questions

Practise Algorithm Design: Greedy Techniques questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

18 on this page
Official PYQ2024AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 2 marks
​​​​Consider an array X\mathrm{X} that contains n\mathrm{n} positive integers. A subarray of X\mathrm{X} is defined to be a sequence of array locations with consecutive indices. The C\mathrm{C} code snippet given below has been written to compute the length of the longest subarray of X\mathrm{X} that contains at most two distinct integers. The …
Official PYQ2021AlgorithmsAlgorithm Design: Greedy TechniquesMSQ · 2 marks
Define RnR_n to be the maximum amount earned by cutting a rod of length nn meters into one or more pieces of integer length and selling them. For i>0i>0, let p[i]p[i] denote the selling price of a rod whose length is ii meters. Consider the array of prices: …
Official PYQ2021AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 2 marks
Consider the string abbccddeee\textrm{abbccddeee}. Each letter in the string must be assigned a binary code satisfying the following properties: For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter. For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is …
Official PYQ2019AlgorithmsAlgorithm Design: Greedy TechniquesNAT · 1 mark
Consider a sequence of 1414 elements: A=[−5,−10,6,3,−1,−2,13,4,−9,−1,4,12,−3,0]A=[-5, -10, 6, 3, -1, -2, 13, 4, -9, -1, 4, 12, -3, 0]. The sequence sum S(i,j)=Σk=ijA[k]S(i,j) = \Sigma_{k=i}^j A[k]. Determine the maximum of S(i,j)S(i,j), where 0≤i≤j<140 \leq i \leq j <14. (Divide and conquer approach may be used.) Answer: ___________
Official PYQ2018AlgorithmsAlgorithm Design: Greedy TechniquesNAT · 2 marks
Consider the weights and values of items listed below. Note that there is only one unit of each item. …
Official PYQ2017AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
Consider the following table: …
Official PYQ2017AlgorithmsAlgorithm Design: Greedy TechniquesNAT · 1 mark
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: …
Official PYQ2015AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
Match the following: …
Official PYQ2015AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
Given below are some algorithms, and some algorithm design paradigms. …
Official PYQ2014AlgorithmsAlgorithm Design: Greedy TechniquesNAT · 1 mark
There are 55 bags labeled 11 to 55. All the coins in a given bag have the same weight. Some bags have coins of weight 1010 gm, others have coins of weight 1111 gm. I pick 1,2,4,8,161, 2, 4, 8, 16 coins respectively from bags 11 to 55 Their total weight comes out to 323323 gm. Then the product of the labels of the bags having 1111 gm coins is …
Official PYQ2007AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
Suppose the letters a, b, c, d, e, fa, \,b, \,c, \,d, \,e, \,f have probabilities 12,14,18,116,132,132\dfrac{1}{2}, \dfrac{1}{4}, \dfrac{1}{8}, \dfrac{1}{16}, \dfrac{1}{32}, \dfrac{1}{32}, respectively. What is the average length of the Huffman code for the letters a, b, c, d, e, fa, \,b, \,c, \,d, \,e, \,f?
Official PYQ2007AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
Suppose the letters a, b, c, d, e, fa, \,b, \,c, \,d, \,e, \,f have probabilities 12,14,18,116,132,132\frac{1}{2}, \frac{1}{4}, \frac{1}{8}, \frac{1}{16}, \frac{1}{32}, \frac{1}{32}, respectively. Which of the following is the Huffman code for the letter a, b, c, d, e, fa, \,b, \,c, \,d, \,e, \,f?
Official PYQ2006AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
An element in an array XX is called a leader if it is greater than all elements to the right of it in XX. The best algorithm to find all leaders in an array
Official PYQ2005AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
We are given 99 tasks T1,T2,…,T9T_1, T_2, \dots, T_9. The execution of each task requires one unit of time. We can execute one task at a time. Each task TiT_i has a profit PiP_i and a deadline did_i. Profit PiP_i is earned if the task is completed before the end of the dithd_i^{th} unit of time. …
Official PYQ2005AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
We are given 99 tasks T1,T2,…,T9T_1, T_2, \dots, T_9. The execution of each task requires one unit of time. We can execute one task at a time. Each task TiT_i has a profit PiP_i and a deadline did_i. Profit PiP_i is earned if the task is completed before the end of the dithd_i^{th} unit of time. …
Official PYQ2003AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
The following are the starting and ending times of activities A,B,C,D,E,F,GA, B, C, D, E, F, G and HH respectively in chronological order: “as bs cs ae ds ce es fs be de gs ee fe hs ge he”“a_s \: b_s \: c_s \: a_e \: d_s \: c_e \: e_s \: f_s \: b_e \: d_e \: g_s \: e_e \: f_e \: h_s \: g_e \: h_e”. Here, xsx_s denotes the starting time and xex_e denotes the ending time of activity X. We need to schedule …
Official PYQ1999AlgorithmsAlgorithm Design: Greedy TechniquesMCQ · 1 mark
The minimum number of record movements required to merge five files A (with 1010 records), B (with 2020 records), C (with 1515 records), D (with 55 records) and E (with 2525 records) is:
Official PYQ1989AlgorithmsAlgorithm Design: Greedy TechniquesNAT · 1 mark
A language uses an alphabet of six letters, {a,b,c,d,e,f}\left\{a, b, c, d, e, f\right\}. The relative frequency of use of each letter of the alphabet in the language is as given below: …