Greedy algorithms

Though the name is greedy algorithms, actually, it is a programming technique that focuses on finding out the best possible solution at the given moment. This means that greedy algorithm makes a locally optimal choice in the hope that it will lead to the globally optimal solution. One thing we have to remember is that not all greedy approaches will take us to globally optimal solutions. However, still, greedy algorithm is applied in many problem-solving areas. One of the most popular uses of greedy algorithm is in Huffman encoding, which is used to encode a big text and compress the string by converting them into different codes. We will explore the concept and implementation of Huffman coding in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset