Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please do this is Python! Given a string Text, a pattern Pattern, and an integer overlap, we denote the size of the largest scattered set
Please do this is Python!
Given a string Text, a pattern Pattern, and an integer overlap, we denote the size of the largest scattered set of occurrences of Pattern in Text as Count(Text, Pattern, overlap). This provides an alternative to Count(Text, Pattern), which we used in the textbook to refer to the total number of occurrences of Pattern in Text (ignoring whether or not any overlaps existed). For example, when Text= GATATATATAC , Pattern = ATATA, and overlap =1,Count( Text, Pattern )=3 but Count( Text, Pattern, overlap )=2. Scattered Pattern Count Problem. Find the size of the largest scattered set of occurrences of a pattern in a text. - Input: A string Pattern, a string Text, and a positive integer overlap. - Output: Count(Text, Pattern, overlap). Implement a program that solves the Scattered Pattern Count Problem. Once you have solved this problem, please submit the code you used to solve this problem on Canvas. Hint. Depending on how you implemented the code for PatternCount, this problem may be solved with only small modifications to this code. But it is also not so difficult to solve it from scratch. Extra Example. When Text= , Pattern =, and overlap =3, the largest scattered set of occurrences of Pattern in Text has size 3 : GATATATATCATATATATATATG ATATAT ATATAT ATATATStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started