Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the code in python or in psude code Thanks Problem 1. (20 points) Make a string match program using a finite automata. However,

image text in transcribed

I need the code in python or in psude code

Thanks

Problem 1. (20 points) Make a string match program using a finite automata. However, you need to modify it so it finds the patter either forwards or backwards. The first word in the input file is the pattern (on its own line). The second word will be the string you are trying to match. Output all indexes where a match starts happening. You may assume we will only put the normal 26 English letters in lower case for both the pattern and string. It is possible for a match to happen twice (if the pattern is symmetric). You should output the index of this match twice then. Assume indexes start from 0 Sample input file (all characters on a single line with no spaces between): abcc abccbabcc Corresponding sample output.txt file (spaces separating indexes (no space after final index)): 0 2 5

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

Step: 3

blur-text-image

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions