Provide In this you will implement a deterministic finite automaton (DFA) using C++ programming language to test if an

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Provide In this you will implement a deterministic finite automaton (DFA) using C++ programming language to test if an

Post by answerhappygod »

Provide
In this you will implement a deterministic finiteautomaton (DFA) using C++ programming language to test if an inputDNA sequence matches a regular expression.
The program should mimic how a DFA processes a string: readingone letter at a time and doing state transitions.
If you are asked to implement DFA for RE(AA+TT)(AA+TT)*,
Below are four sample input/output. Only the bolded strings areuser inputs.
Input a DNA sequence: AATT
The pattern AATT is valid
Input a DNA sequence: AATATTAAAA
The pattern AATATTAAAA is not valid
Input a DNA sequence: AAAAAA
The pattern AAAAAA is valid
Input a DNA sequence: AATTTTAAAA
The pattern AATTTTAAAA is valid
If you are asked to implement DFA for RE(AA+TT)(AA+TT)*,
Below are four sample input/output. Only the bolded strings areuser inputs.
Input a DNA sequence: AATT
The pattern AATT is valid
Input a DNA sequence: AATATTAAAA
The pattern AATATTAAAA is not valid
Input a DNA sequence: AAAAAA
The pattern AAAAAA is valid
Input a DNA sequence: AATTTTAAAA
The pattern AATTTTAAAA is valid
If you are asked to implement DFA for RE(TT+G)*(A+T),
Below are four sample input/output. Only the bolded strings areuser inputs.
Input a DNA sequence: GTTTTGT
The pattern GTTTTGT is valid for RE (TT+G)*(A+T)
Input a DNA sequence: GTTTTG
The pattern GTTTTG is not valid for RE (TT+G)*(A+T)
Input a DNA sequence: TTTGT
The pattern TTTGT is not valid for RE (TT+G)*(A+T)
Input a DNA sequence: TTGTTTTA
The pattern TTGTTTTA is valid for RE (TT+G)*(A+T)
PLEASE MAKE SURE IT WORKS FOR THUMBS UP.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply