Question: Problem 3 Write a code (replication.c) that prints the longest sub-string from the input that occurs more than once, and that does not overlap with


Problem 3 Write a code (replication.c) that prints the longest sub-string from the input that occurs more than once, and that does not overlap with other occurrences of the same substring Your algorithm should be independent from the input size. Give the best Big-O estimate of your algorithm in the worst case. (13 marks) (Hint: See examples below. Note that the longest obtained pattern should be from at least two separable chunks of the input string. Remember to include atring.h, which contains the function strlen.) Example 1: input: abcab output: ab Example 2: input: ababababa output: abab or baba
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
