Question: a) Write an algorithm in pseudo-code (in file h2.doc) in a function find dup_str(s, n) that determines whether a string s contains a duplicated substring

a) Write an algorithm in pseudo-code (in file h2.doc) in a function find dup_str(s, n) that determines whether a string s contains a duplicated substring of a given length n and that returns the first occurring substring of length n that is duplicated (if any) or the empty string, otherwise. For the example above (s-"abcdefbcdgh") with substring length 3, the substring to be returned is "bcd". With length 2, the algorithm returns "bc", and not "cd". For this value of parameter s, if the length parameter is 4 or more, the algorithm returns
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
