Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged greedy-algorithm
1
votes
2
answers
31
What is the time complexity of Make-set function in kruskal algorithm ?
what is the time-complexity in kruskal algorithm for the overall step 2 where for each vertex Make-set function is called ? How come overall time for this step is O(v log v) ? We are performing this Operation for all the ... right because after we come out of loop we have v sets of 1 vertex each . Please explain this clearly .
what is the time-complexity in kruskal algorithm for the overall step 2 where for each vertex Make-set function is called ? How come overall time for this step is O(v lo...
radha gogia
1.2k
views
radha gogia
asked
Jul 22, 2018
Algorithms
algorithms
greedy-algorithm
+
–
4
votes
1
answer
32
Clrs 16.2-6
Show how to solve the fractional knapsack problem in $O(n)$ time.
Show how to solve the fractional knapsack problem in $O(n)$ time.
Prince Sindhiya
1.0k
views
Prince Sindhiya
asked
Jul 22, 2018
Algorithms
algorithms
greedy-algorithm
+
–
2
votes
1
answer
33
Space Complexity of Dijkastra's algorithm
I read that the space complexity of Dijasktra is $O(V^2)$ . (http://igraph.wikidot.com/algorithm-space-time-complexity) But how ????
I read that the space complexity of Dijasktra is $O(V^2)$ . (http://igraph.wikidot.com/algorithm-space-time-complexity)But how ????
Hardik Maheshwari
3.0k
views
Hardik Maheshwari
asked
Jul 5, 2018
Algorithms
dijkstras-algorithm
shortest-path
space-complexity
algorithms
graph-algorithms
greedy-algorithm
+
–
1
votes
1
answer
34
cormen 3rd edition Q. 16.2-6
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?
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 prob...
Aarvi Chawla
2.9k
views
Aarvi Chawla
asked
Jun 19, 2018
Algorithms
greedy-algorithm
+
–
0
votes
1
answer
35
MadeEasy Test Series: Algorithms - Greedy Algorithm
Consider the following graph: If the edge weight of minimum spanning tree are given and edge weight of each edge is distinct, then the minimum value of sum (a, b, c, d, e, f, g) is __________. My Strategy :- According to me a = 11 (because if we see the ... and likewise g = 11,f = 12,b = 8,e = 8,d = 9,c = 6.Hence Sum is = 65 Made Easy Solution :-
Consider the following graph:If the edge weight of minimum spanning tree are given and edge weight of each edge is distinct, then the minimum value of sum (a, b, c, d, e,...
Na462
858
views
Na462
asked
Apr 30, 2018
Algorithms
made-easy-test-series
algorithms
greedy-algorithm
+
–
0
votes
1
answer
36
MadeEasy Test Series: Algorithms - Greedy Algorithm
Consider the following message: The number of bits required for huffman encoding of the above message are __________? My Strategy:- But the answer given is 52bits i used standard Algorithem Made Easy Solution :-
Consider the following message:The number of bits required for huffman encoding of the above message are __________?My Strategy:- But the answer given is 52bits i used st...
Na462
4.4k
views
Na462
asked
Apr 30, 2018
Algorithms
made-easy-test-series
huffman-code
greedy-algorithm
algorithms
+
–
38
votes
5
answers
37
GATE CSE 2018 | Question: 48
Consider the weights and values of items listed below. Note that there is only one unit of each item. ... The total value of items picked by the greedy algorithm is denoted by $V_{greedy}$. The value of $V_{opt}-V_{greedy}$ is ____
Consider the weights and values of items listed below. Note that there is only one unit of each item.$$\begin{array}{|c|c|c|}\hline \textbf{Item number} & \textbf{Weigh...
gatecse
22.3k
views
gatecse
asked
Feb 14, 2018
Algorithms
gatecse-2018
algorithms
greedy-algorithm
numerical-answers
2-marks
+
–
0
votes
3
answers
38
Gate 2018
Value of V GREEDY - V OPT
Value of V GREEDY - V OPT
Ashok
1.9k
views
Ashok
asked
Feb 4, 2018
Algorithms
gatecse-2018
greedy-algorithm
+
–
2
votes
0
answers
39
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)? P-Q, Q-R, R-W, R-S, V-X, V-U, W-V, S-T P-Q, Q-R, R-W, W-V, V-X, V-U, R-S, S-T P-Q, P-X, X-V, V-U, U-R, R-S, R-W, S-T P-Q, P-X, X-V, V-U, U-R, R-W, R-S, S-T PLEASE EXPLAIN.
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...
ankit_thawal
1.3k
views
ankit_thawal
asked
Jan 8, 2018
Algorithms
prims-algorithm
spanning-tree
minimum-spanning-tree
greedy-algorithm
+
–
1
votes
0
answers
40
MadeEasy Test Series: Algorithms - Spanning Tree
can someone provide a detailed solution of this??
can someone provide a detailed solution of this??
Kalpataru Bose
694
views
Kalpataru Bose
asked
Dec 31, 2017
Algorithms
made-easy-test-series
algorithms
graph-algorithms
spanning-tree
minimum-spanning-tree
greedy-algorithm
+
–
1
votes
1
answer
41
Greedy vs Dynamic
Unlike greedy algorithms, dynamic programming method always provide correct/optimal solution. Is the above statement correct?
Unlike greedy algorithms, dynamic programming method always provide correct/optimal solution.Is the above statement correct?
Tuhin Dutta
6.3k
views
Tuhin Dutta
asked
Dec 13, 2017
Algorithms
algorithms
greedy-algorithm
dynamic-programming
+
–
0
votes
1
answer
42
Knapsack
The following Knapsack bag. The Knapsack bag maximum Capacity is 50. Find out the maximum profit for Fractional Knapsack. P Q R S T U V W Weight 18 12 16 14 16 20 10 15 Profit 34 15 22 16 17 22 18 26 90 80.25 85.50 91.2
The following Knapsack bag. The Knapsack bag maximum Capacity is 50. Find out the maximum profit for Fractional Knapsack. PQRSTUVWWeight1812161416201015Profit341522161722...
Parshu gate
8.3k
views
Parshu gate
asked
Nov 16, 2017
Algorithms
algorithms
greedy-algorithm
knapsack-problem
+
–
2
votes
2
answers
43
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 ____________
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 techni...
set2018
794
views
set2018
asked
Nov 11, 2017
Algorithms
algorithms
greedy-algorithm
+
–
0
votes
2
answers
44
Activity Selection Problem
11. Explain and write an algorithm for greedy method of algorithm design. Given 10 activities along with their start and finish time as: A={A1,A2, A3, A4, A5, A6, A7, A8, A9, A10} S={1, 2, 3, 4, 7, 8, 9,9, 11, 12} F={3, 5, 4, 7, 10, 9, 11, 13, 12, 14} Compute a schedule where the largest numbers of activities take place.
11. Explain and write an algorithm for greedy method of algorithm design. Given 10 activities along with their start and finish time as:A={A1,A2, A3, A4, A5, A6, A7, A8, ...
Syedabbas110
9.1k
views
Syedabbas110
asked
Oct 30, 2017
Algorithms
algorithm-design
greedy-algorithm
+
–
4
votes
1
answer
45
algorithms practice question
problem of making change for n cents using the fewest number of coins
problem of making change for n cents using the fewest number of coins
Pavan Kumar Munnam
1.1k
views
Pavan Kumar Munnam
asked
Aug 10, 2017
Algorithms
algorithms
greedy-algorithm
+
–
1
votes
1
answer
46
algorithm
worst case time complexity of job sequencing with deadline using greedy algorithm
worst case time complexity of job sequencing with deadline using greedy algorithm
A_i_$_h
971
views
A_i_$_h
asked
Jul 24, 2017
Algorithms
time-complexity
greedy-algorithm
+
–
0
votes
3
answers
47
Optimal Merge Pattern
What will be the time complexity to obtain optimal merge pattern to merge files using greedy technique?
What will be the time complexity to obtain optimal merge pattern to merge files using greedy technique?
Deeptimittal97
10.2k
views
Deeptimittal97
asked
Jul 6, 2017
Algorithms
algorithms
time-complexity
greedy-algorithm
+
–
4
votes
1
answer
48
Test by Bikram | Mock GATE | Test 4 | Question: 4
Consider a sorted array of $p$ numbers. What would be the time complexity of the best known algorithm to find a pair $x$ and $y$ such that $\left | x-y \right |$ $=$ $m$ (where $m$ is a positive integer) ? $O$\left ( \log p \right )$ $ ... \right )$ $O$\left ( p^{2} \right )$ $O$\left ( p\log p \right )$but not in $O$\left ( p \right )$
Consider a sorted array of $p$ numbers. What would be the time complexity of the best known algorithm to find a pair $x$ and $y$ such that $\left | x-y \right |$ $=$ $m$ ...
Bikram
506
views
Bikram
asked
May 14, 2017
Algorithms
tbb-mockgate-4
algorithms
greedy-algorithm
+
–
0
votes
0
answers
49
Doubt regarding Activity selection problem
Given n activities with their start and finish times.Select d mad no of activities dat can be performed by a single person assuming tat a person can only work on a single activity at a time
Given n activities with their start and finish times.Select d mad no of activities dat can be performed by a single person assuming tat a person can only work on a sin...
Devshree Dubey
2.8k
views
Devshree Dubey
asked
May 6, 2017
Algorithms
algorithms
greedy-algorithm
+
–
0
votes
1
answer
50
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.
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 apply...
LavTheRawkstar
4.0k
views
LavTheRawkstar
asked
Apr 15, 2017
Algorithms
algorithms
knapsack-problem
greedy-algorithm
+
–
1
votes
1
answer
51
Find the shortest tour for given graph using greedy approach
... directed graph as forward /backward distances are not same. But how to solve using Greedy Approach using TravelSalesman Problem(TSP) ?
$\begin{bmatrix} 0& 29& 19& 25& 22\\ 20& 0& 21& 23& 21\\ 19& 21& 0& 21& 20\\ 25& 23& 21& 0& 32\\ 22& 21& 20& 22& 0 \end{bmatrix}$Find the shortest tour for given graph us...
LavTheRawkstar
1.7k
views
LavTheRawkstar
asked
Feb 28, 2017
Algorithms
algorithms
greedy-algorithm
travelling-salesman-problem
+
–
1
votes
1
answer
52
Consider the Knapsack incidence with n=3(items) with weights {w1,w2,w3}={2,3,4} and profits are {p1,p2,p3}={1,2,5}
Consider the Knapsack incidence with n=3(items) with weights {w1,w2,w3}={2,3,4} and profits are {p1,p2,p3}={1,2,5}Given the capacity is 5,{W/M = 5 } Find the optimal solu...
LavTheRawkstar
13.2k
views
LavTheRawkstar
asked
Feb 28, 2017
Algorithms
knapsack-problem
greedy-algorithm
+
–
4
votes
3
answers
53
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
US portal Denominations are 1,10,21,34,70 , 100 and 350 . A) Make 140 Cents .Verify whether Greedy choice fails or notB) Make 182 Cents.Verify whether greedy choice fails...
LavTheRawkstar
1.5k
views
LavTheRawkstar
asked
Feb 28, 2017
Algorithms
algorithms
greedy-algorithm
+
–
2
votes
1
answer
54
Test by Bikram | Mock GATE | Test 3 | Question: 35
Consider the following set of messages with their frequencies: ... The percentage improvement for total binary stream transmission using Huffman Encoding over simple encoding is _______ %.
Consider the following set of messages with their frequencies: $$\begin{array}{|c|c|c|} \hline \textbf{Message} & \textbf{Frequency} \\ \hline A & 50\: \text{million} \...
Bikram
884
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
numerical-answers
algorithms
greedy-algorithm
huffman-code
+
–
2
votes
4
answers
55
Testbook Test Series: Algorithms - Greedy Algorithm
The optimal time required in merging the list of size 11, 21, 33, 34,45,54,60 is my answer (11+21)*4+ 33*3 +(34+45)*3 + (54+60)*2 but the provided answer is 269 to 282 I don't think I have solved it wrong but just want to confirm is there any other way to do this?
The optimal time required in merging the list of size 11, 21, 33, 34,45,54,60 ismy answer (11+21)*4+ 33*3 +(34+45)*3 + (54+60)*2but the provided answer is 269 to 282I don...
Pankaj Joshi
2.0k
views
Pankaj Joshi
asked
Jan 22, 2017
Algorithms
testbook-test-series
test-series
merging
algorithms
greedy-algorithm
+
–
6
votes
2
answers
56
Knapsack-Greedy
Sarvottam Patel
1.9k
views
Sarvottam Patel
asked
Jan 21, 2017
Algorithms
greedy-algorithm
knapsack-problem
algorithms
+
–
3
votes
3
answers
57
Time complexity of fractionak knapsack using greedy algorithm is O(n^2)??TRUE/FALSE
i know time complexity is O(nlogn) but can upper bound given in question consider as TRUE..
i know time complexity is O(nlogn) but can upper bound given in question consider as TRUE..
firki lama
13.4k
views
firki lama
asked
Jan 12, 2017
Algorithms
greedy-algorithm
algorithms
+
–
2
votes
2
answers
58
machine scheduling problem
iita
692
views
iita
asked
Dec 16, 2016
Algorithms
greedy-algorithm
job-scheduling
numerical-answers
test-series
+
–
0
votes
0
answers
59
Test by Bikram | Data Structures | Test 2 | Question: 26
Suppose letters a,b,c,d,e,f have probabilities ½, ¼, 1/8, 1/16, 1/32, 1/32. Which of the following is the Huffman code for the letters a,b,c,d,e,f. 0, 10, 110, 1110, 11110, 11111 11, 10, 01, 001, 0001, 0000 11, 10, 011, 010, 001, 000 110, 100, 010, 000, 001, 111
Suppose letters a,b,c,d,e,f have probabilities ½, ¼, 1/8, 1/16, 1/32, 1/32. Which of the following is the Huffman code for the letters a,b,c,d,e,f.0, 10, 110, 1110, 111...
Bikram
400
views
Bikram
asked
Nov 26, 2016
Programming in C
tbb-ds-2
huffman-code
greedy-algorithm
+
–
23
votes
3
answers
60
GATE CSE 2005 | Question: 84b
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 ... $} & \text{$3$} \\\hline \end{array}$ What is the maximum profit earned? $147$ $165$ $167$ $175$
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$...
go_editor
5.0k
views
go_editor
asked
Nov 15, 2016
Algorithms
gatecse-2005
algorithms
greedy-algorithm
process-scheduling
normal
+
–
Page:
« prev
1
2
3
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register