Given arrival and departure times of all trains that reach a railway station, find the minimum number of platforms required for the railway station so that no train waits.
There are given n ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths.
Given a string and a positive integer d. Some characters may be repeated in the given string.
We introduced graph coloring and applications in previous post. As discussed in the previous post, graph coloring is widely used.
We recommend to read following two posts as a prerequisite of this post. 1. Greedy Algorithms | Set 7 (Dijkstra’s shortest path algorithm) 2. Graph and its representations
Given a graph and a source vertex in graph, find shortest paths from source to all vertices in the given graph.
We recommend to read following two posts as a prerequisite of this post.
We have discussed Kruskal’s algorithm for Minimum Spanning Tree. Like Kruskal’s algorithm, Prim’s algorithm is also a Greedy algorithm. It starts with an empty spanning tree.
We recommend to read following post as a prerequisite for this. Greedy Algorithms | Set 3 (Huffman Coding) Time complexity of the algorithm discussed in above post is O(nLogn).
Huffman coding is a lossless data compression algorithm. The idea is to assign variable-legth codes to input characters, lengths of the assigned codes are based on the frequencies of corresponding characters.
What is Minimum Spanning Tree? Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together.