Recent questions tagged greedy-algorithms

1 1 vote
1 1 answer
87
87 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
98
98 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
112
112 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
101
101 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
410
410 views
1 1 vote
3 3 answers
555
555 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
186
186 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.2k
1.2k 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
525
525 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
831
831 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...
23 23 votes
4 4 answers
1.5k
1.5k 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...
11 11 votes
2 2 answers
1.4k
1.4k 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
696
696 views
1 1 vote
2 2 answers
3.6k
3.6k views
$0/1$-Knapsack is a well known problem where, it is desired to get the maximum total profit by placing $n$ items (each item is having some weight and associated profit) i...