Question: Please implement both parts in Java Problem: Given an input string, search that input string in a larger text using KMP algorithm. 1. For the

Please implement both parts in JavaPlease implement both parts in Java Problem: Given an input string, search

Problem: Given an input string, search that input string in a larger text using KMP algorithm. 1. For the first part, enter a string through standard input. Search for that string in a text file. Return all instances of occurrence of that string in that file. For ease, the file as well as standard input can only contain the visible ASCII characters. Your output contains context where the string is found ( 7 characters before and 3 characters after) 2. For part two, if your search through KMP is unsuccessful, you have to return strings closest to the current string. (Edit distance). Your edit distance should not exceed 0.5n,n being the length of input string. Your output would return top 5 closest matches of the input string. Implement your algorithm in C++ or Java. Here is specification for the input an output of your program. Input: Single line. The line contains n characters The second input file should be in the same folder as the project. It could conatain anything in plain text. Sample input: algorithm design Output: 1. ... course algorithm design is ... 2. ... ing of algorithm design in ... 3. ... enting logarithmic design i... (approximate) (etc)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!