Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(d) A data pattern analyser is to be built that can detect and count up the number of occurrences of two- and three-letter same letter

image text in transcribed

(d) A data pattern analyser is to be built that can detect and count up the number of occurrences of two- and three-letter same letter sequences in a sequence (e.g. (a,a) or (b,b,b)). The analyser should stop if it encounters * in the sequence and return the number of occurrences found up to that point in the form of a 2-tuple (#2LetterSequences, #3LetterSequences). A 3-letter sequence should only count as a 3-letter sequence, not an occurrence of two 2-letter sequences. No letter in the input sequence ever occurs more than 3 times in a row. So, for example: Input string (a,b,a,b,b,a,a,*) (x,x,x,y,y) (p,q,p,z,z,*) (*,a,a) (x,x,a,d,*, s,s,s,1) 2-letter sequences found 2 1 1 3-letter sequences found 0 1 0 0 0 0 1 Produce a formal statement of this problem, and then write an algorithm to solve the problem using a pseudo code style similar to the one shown in parts (a) to (c). State the bounds on the best- and worst-case performance of your algorithms using O, N and o appropriately to receive full marks

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions