Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 Javaimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions