The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
Facebook Login
Google Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged greedyalgorithm
0
votes
0
answers
1
Fibonacci number time complexity
Consider the following code segment to find the $n^{th}$ Fibonacci number: Fib(n) { if(n==0) {return 0;} if(n==1) {return 1;} else { return(Fib(n1) + Fib(n2)); } } The time complexity of the above code and time complexity of the same problem solved using dynamic programming is______ $A)O(n^{2}),O(n)$ $B)O(2^{n}),O(n)$ $C)O(2^{n}),O(n^{2})$ $D)$None of the above
asked
Nov 13
in
Algorithms
by
Lakshman Patel RJIT
Boss
(
20.8k
points)

53
views
algorithms
greedyalgorithm
dynamicprogramming
0
votes
1
answer
2
Job Sequencing Problem (Greedy Algorithm)
asked
Nov 10
in
Algorithms
by
Lakshman Patel RJIT
Boss
(
20.8k
points)

202
views
algorithms
greedyalgorithm
deadlines
0
votes
1
answer
3
Greedy Method Algorithm
Single source shortest path problems can be implemented by greedy algorithms using A. Singly linked list B. Min heap C. AVL tree D. All of the above
asked
Sep 25
in
Algorithms
by
Vaishnavi01
(
215
points)

64
views
greedyalgorithm
gate
+1
vote
1
answer
4
Massachusetts Institute of Technology Professors Ronald L. Rivest and Sivan Toledo
asked
Jul 30
in
Algorithms
by
Rishav Kumar Singh
Active
(
4.6k
points)

80
views
greedyalgorithm
dijkstrasalgorithm
+1
vote
0
answers
5
Massachusetts Institute of Technology Professors Ronald L. Rivest and Sivan Toledo
asked
Jul 30
in
Algorithms
by
Rishav Kumar Singh
Active
(
4.6k
points)

32
views
greedyalgorithm
0
votes
0
answers
6
self doubt on HUFFMAN
in Huffman Code, we get extract the minimum at each time, but my minimum is creating duplicate, then which one i choose? i am getting the same avg.no.of bits for every Huffman tree, but the problem is my tree is changing therefore representing the character also changed, if some one asks ... $\frac{12}{30} $
asked
Jul 26
in
Algorithms
by
Shaik Masthan
Boss
(
42.8k
points)

83
views
greedyalgorithm
huffmancode
0
votes
0
answers
7
What is the time complexity of Makeset function in kruskal algorithm ?
asked
Jul 22
in
Algorithms
by
radha gogia
Loyal
(
7.9k
points)

66
views
algorithms
greedyalgorithm
+4
votes
1
answer
8
Clrs 16.26
Show how to solve the fractional knapsack problem in $O(n)$ time.
asked
Jul 22
in
Algorithms
by
Prince Sindhiya
Loyal
(
5.3k
points)

91
views
algorithms
greedyalgorithm
0
votes
0
answers
9
Space Complexity of Dijkastra's algorithm
asked
Jul 5
in
Algorithms
by
Hardik Maheshwari
(
81
points)

211
views
dijkstrasalgorithm
shortestpath
spacecomplexity
algorithms
graphalgorithms
greedyalgorithm
0
votes
1
answer
10
cormen 3rd edition Q. 16.26
Show how to solve the fractional knapsack problem in O(n) time. The solution include that we can find the median in O(n) time and then solving the fractional knapsack problem on input of size n/2, but the pi/wi is not sorted, so how do we have the equation T(n) = T(n/2) + cn?
asked
Jun 19
in
Algorithms
by
Aarvi Chawla
(
47
points)

93
views
greedyalgorithm
+9
votes
5
answers
11
GATE201848
Consider the weights and values of items listed below. Note that there is only one unit of each item. Item number Weight (in Kgs) Value (in rupees) $1$ $10$ $60$ $2$ $7$ $28$ $3$ $4$ $20$ $4$ $2$ $24$ The task is to pick a subset of these ... the ordered list. The total value of items picked by the greedy algorithm is denoted by $V_{greedy}$. The value of $V_{opt}V_{greedy}$ is ____
asked
Feb 14
in
Algorithms
by
gatecse
Boss
(
18.3k
points)

3.3k
views
gate2018
algorithms
greedyalgorithm
numericalanswers
+2
votes
0
answers
12
TEST SERIES
Consider the following graph and Assume node ‘P’ as the starting vertex for Prim’s algorithm. Which of the following can be the correct order of edges to which they are added to construct Minimum Spanning Tree (MST)? PQ, QR, RW, RS, VX, VU, WV, ST PQ, QR, RW, WV, VX, VU, RS, ST PQ, PX, XV, VU, UR, RS, RW, ST PQ, PX, XV, VU, UR, RW, RS, ST PLEASE EXPLAIN.
asked
Jan 8
in
Algorithms
by
ankit_thawal
Active
(
2.1k
points)

194
views
primsalgorithm
spanningtree
minimumspanningtrees
greedyalgorithm
+1
vote
1
answer
13
Greedy vs Dynamic
Unlike greedy algorithms, dynamic programming method always provide correct/optimal solution. Is the above statement correct?
asked
Dec 13, 2017
in
Algorithms
by
Tuhin Dutta
Loyal
(
8.5k
points)

469
views
algorithms
greedyalgorithm
dynamicprogramming
+2
votes
1
answer
14
Optimal Merge Pattern
Given a set of sorted files f1,f2,f3,f4,f5 of lengths 99,27,71,199,259 we need to merge these files into a single sorted file Using Optimal Merge Pattern.
asked
Dec 13, 2017
in
Algorithms
by
VIKAS TIWARI
Junior
(
599
points)

781
views
optimalmergepattern
algorithms
greedyalgorithm
0
votes
1
answer
15
Knapsack
The following Knapsack bag. The Knapsack bag maximum Capacity is 50. Find out the maximum profit for Fractional Knapsack. 90 80.25 85.50 91.2
asked
Nov 17, 2017
in
Algorithms
by
Parshu gate
Active
(
5k
points)

424
views
algorithms
knapsack
greedyalgorithm
fractional
+2
votes
2
answers
16
greedy technique
Assume coins with denominator 20,15,5 and 1 are available ,we are required to make a sum of 33,using minimum number of coins.Difference between answer using greedy technique and correct answer will be ____________
asked
Nov 11, 2017
in
Algorithms
by
set2018
Loyal
(
8.2k
points)

136
views
algorithms
greedyalgorithm
+4
votes
1
answer
17
algorithms practice question
problem of making change for n cents using the fewest number of coins
asked
Aug 10, 2017
in
Algorithms
by
Pavan Kumar Munnam
Boss
(
11k
points)

176
views
algorithms
greedyalgorithm
0
votes
1
answer
18
Fractional Knapsack(Greedy Method)
Consider the following instance of the knapsack problem: n=3 , W=50 , (v1,v2,v3) = (60,100,120) and weight (w1,w2,w3) = (10,20,30) . solve the given knapsack problem applying greedy algorithm.
asked
Apr 15, 2017
in
Algorithms
by
LavTheRawkstar
Active
(
5.2k
points)

285
views
algorithms
knapsack
greedyalgorithm
+1
vote
1
answer
19
Find the shortest tour for given graph using greedy approach
asked
Mar 1, 2017
in
Algorithms
by
LavTheRawkstar
Active
(
5.2k
points)

361
views
algorithms
greedyalgorithm
travellingsalesmanproblem
+4
votes
2
answers
20
Greedy Algorithm Confusing Question
US portal Denominations are 1,10,21,34,70 , 100 and 350 . A) Make 140 Cents . Verify whether Greedy choice fails or not B) Make 182 Cents. Verify whether greedy choice fails or not. 1)Greedy fails in A 2) Greedy fails in B 3)Greedy does not fails in A 4)Greedy does not fails in B
asked
Feb 28, 2017
in
Algorithms
by
LavTheRawkstar
Active
(
5.2k
points)

412
views
algorithms
greedyalgorithm
+5
votes
2
answers
21
KnapsackGreedy
asked
Jan 21, 2017
in
Algorithms
by
Sarvottam Patel
Active
(
1.1k
points)

462
views
greedyalgorithm
knapsack
algorithms
+2
votes
3
answers
22
Time complexity of fractionak knapsack using greedy algorithm is O(n^2)??TRUE/FALSE
asked
Jan 12, 2017
in
Algorithms
by
firki lama
Junior
(
887
points)

3.4k
views
greedyalgorithm
algorithms
+17
votes
2
answers
23
GATE200584b
We are given $9$ tasks $T_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 $T_i$ has a profit $P_i$ and a deadline $d_i$. Profit $P_i$ is earned if the task is completed before the end of the $d_i^{th}$ unit ... Deadline $7$ $2$ $5$ $3$ $4$ $5$ $2$ $7$ $3$ What is the maximum profit earned? $147$ $165$ $167$ $175$
asked
Nov 15, 2016
in
Algorithms
by
jothee
Veteran
(
112k
points)

730
views
gate2005
algorithms
greedyalgorithm
processschedule
normal
+1
vote
1
answer
24
UGCNETJune2014III62
Consider the fractional knapsack instance $n = 4, (p_{1} , p_{2} , p_{3} , p_{4} ) = (10, 10, 12, 18), (w_{1} , w_{2} , w_{3} , w_{4} ) = (2, 4, 6, 9)$ and $M = 15$. The maximum profit is given by (Assume $p$ and $w$ denotes profit and weight of objects respectively) $40$ $38$ $32$ $30$
asked
Jul 11, 2016
in
Algorithms
by
makhdoom ghaya
Boss
(
40.5k
points)

1.4k
views
ugcnetjune2014iii
algorithms
greedyalgorithm
knapsack
+5
votes
1
answer
25
Optimal Substructure
asked
Jun 29, 2016
in
Algorithms
by
geet.m
(
203
points)

241
views
algorithms
greedyalgorithm
optimal
substructure
+13
votes
1
answer
26
CMI2015B04
You are given $n$ positive integers, $d_1, d_2 \dots d_n$, each greater than $0$. Design a greedy algorithm to test whether these integers correspond to the degrees of some $n$vertex simple undirected graph $G = (V, E)$. [A simple graph has no selfloops and at most one edge between any pair of vertices].
asked
May 27, 2016
in
Algorithms
by
jothee
Veteran
(
112k
points)

367
views
cmi2015
descriptive
algorithms
greedyalgorithm
+14
votes
2
answers
27
GATE200777
Suppose the letters $a, \,b, \,c, \,d, \,e, \,f$ have probabilities $\frac{1}{2}, \frac{1}{4}, \frac{1}{8}, \frac{1}{16}, \frac{1}{32}, \frac{1}{32}$, respectively. What is the average length of the Huffman code for the letters $a, \,b, \,c, \,d, \,e, \,f$? $3$ $2.1875$ $2.25$ $1.9375$
asked
Apr 23, 2016
in
Algorithms
by
jothee
Veteran
(
112k
points)

1.6k
views
gate2007
algorithms
greedyalgorithm
normal
huffmancode
+2
votes
1
answer
28
AlGO: Madeeasy:TS Greedy Method How to approach
asked
Jan 29, 2016
in
Algorithms
by
Prasanna
Active
(
4.8k
points)

612
views
algorithms
greedyalgorithm
madeeasytestseries
+2
votes
1
answer
29
Optimal solution with greedy algorithm
Q: There are n white dots and n black dots, equally spaced in a line. We want to each white dot with some black dot in ontoone fashion with a minimum total length of the wire. (See diagram above). Greedy algo. gives optimal solution for.. A) Only i B) Only ii C) Both D) None How to approach to such type of questions ?
asked
Jan 18, 2016
in
Algorithms
by
Tushar Shinde
Active
(
2.7k
points)

623
views
algorithms
greedyalgorithm
madeeasytestseries
+5
votes
1
answer
30
In Optimal merge pattern when do we get more than one tree?
asked
Dec 16, 2015
in
Algorithms
by
Shashank Chavan
Active
(
3.3k
points)

1.1k
views
algorithms
greedyalgorithm
Page:
1
2
next »
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
[PSU FORM FILLING UPDATE]
IIT HYDERABAD M.Tech (RA) 3Years Winter Session Interview experience
INDIAN AIR FORCE
GATE BOOK _ TEST SERIES DOUBT_
Visualizing complex C code
Follow @csegate
Gatecse
Recent questions tagged greedyalgorithm
Recent Blog Comments
open the link and you will...
In
“PSU PERCENTAGE...
First of all, congratulations!
I can...
Congrats man. You wrote gate in B.Tech 3rd year?
Thank You so much sir for giving tips. I will...
44,337
questions
49,834
answers
164,738
comments
65,874
users