Recent questions tagged greedy-algorithms

1 1 vote
1 1 answer
159
159 views
Suppose Huffman coding is implemented as follows.Initially, the $n$ symbols are stored in a min priority queue according to their frequencies.The algorithm repeatedly per...
0 0 votes
1 1 answer
122
122 views
Which of the following are limitations of Greedy algorithms?They always fail for NP hard problem.They may not give the optimal solution for all problems.They are faster t...
0 0 votes
1 1 answer
155
155 views
Match the LIST-I with LIST-IILIST-ILIST-IIA.Dynamic programmingI.Floyd Warshall Shortest pathB.GreedyII.Huffman codingC.Back trackingIII.Hamiltonian cycle problemD.Branch...
0 0 votes
1 1 answer
124
124 views
Match the LIST-I with LIST-IILIST - ILIST - IIA.Dijkstra's AlgorithmI.GPS route findingB.Huffman CodingII.Data compressionC.KMP string matchingIII.Text editor search func...
1 1 vote
1 1 answer
431
431 views
0 0 votes
1 1 answer
140
140 views
Which of the following is true about Greedy algorithm?does not make any optimizationmakes local optimal decisions based on the selected criterionrequires exhaustive searc...
1 1 vote
3 3 answers
591
591 views
Which of the following algorithms use Greedy strategy?Dijkstra's algorithmKruskal's algorithmHuffman codingBellman-Ford algorithmChoose the correct answer from the option...
0 0 votes
1 1 answer
199
199 views
Which of the following problems can be solved using a greedy approach?Knapsack problem ($0/1$ version)Job Scheduling with deadlines and profitsFibonacci sequence calculat...
1 1 vote
1 answers 1 answer
1.3k
1.3k views
Which of the statement is/are correct?(a) First edge added by Kruskal’s algorithm can be the last edge added by prim’s algorithm(b) In a graph, if one raises the length o...
0 0 votes
1 1 answer
535
535 views
As we have to select maximal set of “non overlapping” activities. So like job scheduling algo of greedy we can solve it. So according to that complexity must be O(n logn)...
1 1 vote
1 1 answer
3.0k
3.0k views
consider the following message BCCABBDDAECCBBAEDDCC find the no of bits requiered for huffman encoding of above message
3 3 votes
2 answers 2 answers
2.6k
2.6k views
Can anyone help in solving the question 105 to 109.I don't have answer key I want to confirm my answer ...i will update my answer in the comments.
3 3 votes
1 1 answer
845
845 views
Given a set $\mathcal{F}$ of intervals $\left(s_{i}, t_{i}\right)_{i=1}^{n}$ on the integer line (assume all $s_{i}, t_{i}$ are distinct), a subset $S$ of $\mathcal{F}$ i...
24 24 votes
4 4 answers
1.7k
1.7k views
Consider yourself an engineer who wants to design a greedy algorithm for a tour company.The tour company will be given a list of $n$ tourists, each with a positive minimu...
13 13 votes
2 2 answers
1.6k
1.6k views
Recall the Interval Scheduling Problem. A set of $n$ requests is given, each with a given start and finish time, $[s_i, f_i ].$ The objective is to compute the maximum nu...
0 0 votes
1 answers 1 answer
2.7k
2.7k views
Consider the following items with their associated weights and values. If a knapsack of capacity 25 units of weight is available and we are allowed to take either the ite...
0 0 votes
1 1 answer
727
727 views