Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write in python. ( b ) Write a function pattern _ count , pattern, . . . ) that takes the two Rerable objects

Please write in python.(b) Write a function pattern_count , pattern, ...) that takes the two Rerable objects x and pattern and retums the length of the longest
subsequence of pattern . Run:
patterncount('CGGACTACTAGACT', 'ACT')
patterncount ((1,(1,1,1,1),2,1,1,1),[1,1])
patterncount (['ab',?'ab',?'a',?'a',b'],('ab',))
(c) For a long string, write code that takes strings x, pattern , and an integer n?splits, and uses a suitable concurrency method to search for repeating
patterns using pattern_count from (b). To this end, partition x into nsplits parts and search each of them individually. Make sure not to spil where a
pattern is present Run:
fron randon import choices, seed
seed (2e24)
x ="'. join(cholces ("01', k =5_080))
pattern ="e1"
n_splits =50
# here is your code
Hint: You can use the fast x.f ind (pattern) to check your code.
image text in transcribed

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

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions