Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pattern Matching & Back-of-the-Envelope Estimations The pattern matching problem can be stated as: Score Given a (usually long) text string t and a (usually shorter)

Pattern Matching & Back-of-the-Envelope Estimations

The pattern matching problem can be stated as: Score

Given a (usually long) text string t and a (usually shorter) pattern p find where or if the pattern p occurs in t. Assume the length of t is n and the length of p is m Several algorithms were presented in the course notes to solve the pattern matching problem Here are two: • Brute-Force: The notes state the time complexity of this approach to solving the problem is O(mn). • Knuth-Morris-Pratt: The notes state the time complexity of this approach to solving the problem is O(m + n). The human genome is approximately three billion base pairs in size. the average length of a gene is approximately 30 thousand base pairs. Let m = 30, 000 and n = 3, 000, 000, 000 There are about 30, 000, 000 seconds in a year. Assume a character-to-character comparison takes 1 microsecond. Estimate the time it will take to run a brute-force algorithm. Do the same for the KMP algorithm.

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

Data Structures and Algorithm Analysis in Java

Authors: Mark A. Weiss

3rd edition

132576279, 978-0132576277

More Books

Students also viewed these Algorithms questions

Question

Modify the splay tree to support queries for the kth smallest item.

Answered: 1 week ago

Question

2. How do we perceive middle-frequency sounds (100 to 4000 Hz)?

Answered: 1 week ago

Question

20. What is a feature detector?

Answered: 1 week ago