Showing posts from September, 2017

SPOJ Problem - CPTTRN5 - Character Patterns (Act 5)

This is a problem from SPOJ. We have to print a character pattern according to the input given.

We have input 

33 1 24 4 12 5 2

C++: Huffman Coding using STL

Huffman Code compress data very effectively: saving of 20% to 90% are typical, depending on the characteristics of the data being compressed.Huffman's greedy algorithm uses a table giving how often each character occurs (i.e., its frequency) to build up an optimal way of representing each character as a binary string. This algorithm constructs an optimal prefix code called a Huffman Code.

C++: Maximum Priority Queue

In a Priority Queue, an element with high priority is served before an element with low priority. If two elements have the same priority, they are served according to their order in the queue.

While priority queues are often implemented with heaps, they are conceptually distinct from heaps. [Wikipedia]

Popular Posts

C++: STL Iterators

C++: Implementation of Merge Sort

Top 10 Web Sites Every Programmer Should Visit Daily