Category Archives: Divide and Conquer

Longest Common Prefix | Set 3 (Divide and Conquer)

Given a set of strings, find the longest common prefix. Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”} Output : “gee” Input : {“apple”, “ape”, “april”} Output : “ap” We have discussed word by word matching and character by character matching algorithms. In this algorithm, a divide and conquer approach is discussed. We first divide the arrays… Read More »