Longest Common Prefix using Trie

In the Longest Common Prefix using Trie problem we have given a set of strings, find the longest common prefix. i.e. find the prefix part that is common to all the strings. Example Input1: {“tutorialcup”, “tutorial”, “tussle”, “tumble”} Output: “tu” Input2: {“baggage”, “banana”, “batsmen”} Output: “ba” Input3: {“abcd”} Output: “abcd” …

Read more

Kruskal Algorithm

What is Kruskal Algorithm? Kruskal’s algorithm is used to find the minimum spanning tree(MST) of a connected and undirected graph. Example Graph Minimum Spanning Tree(MST) Algorithm Kruskal’s algorithm is a greedy algorithm to find the minimum spanning tree. Sort the edges in ascending order according to their weights. At every …

Read more

Guess The Word

Guess The Word is an interactive problem. An interactive problem means the data which is given to us is not predetermined. We can print values or call the specific function to interact or get more information regarding the solution. After each step, we also need to FLUSH the buffer to …

Read more

Translate »