Chapter 23 Flashcards
Where greedy algorithm used
For optimization
Does greedy algorithm use recursion
No
What is backtrack search
Its a search technique
What are 2 phases of greedy algorithm
1- We can take the best you can get right now, without regard for future consequences.
2- We hope that choosing a local optimum at each step, you will end up a global optimum.
What is backtrack
Decide and move on to one strategy and then taking that decision back and leave that strategy
What is greedy approximation
Greedy finds good but not best
In which case greedy algorithm gives optimal solution
Entities are all powers of a fixed denomination
How much time greedy algorithm takes
O(k)
How much time dynamic programming takes
O(kn)
What is huffmen encoding
Lets suppose we have data (text, ASCII etc) and we want to send in over network. We need to convert it into smaller chunks for speed point of view. We also want to compress it so it will take minimum numbers of bits during transfer. For compressing, we will use huffmen encoding.
Does greedy algorithm have any link with huffmen encoding
Yes