Question: Question 2 ( 2 9 marks ) This question can be answered after studying Chapter 2 3 ( Dynamic Programming ) . It assesses the
Question marks
This question can be answered after studying Chapter Dynamic Programming It assesses the learning outcomes:
Develop and apply algorithms and data structures to solve computational problems.
Analyse the complexity of algorithms to support software design choices.
Explain how an algorithm or data structure works, in order to communicate with relevant stakeholders.
Write readable, tested, documented and efficient Python code.
In this question we aim to solve the same problem as in Question given any two DNA sequences strings containing only C G A or T find their longest common substring but using a different approach.
You should provide a dynamic programming solution, following the examples in Chapter adapting code as appropriate. You will lose marks if you do not follow an approach similar to Chapter
Qa marks
Write and test a recursive Python function lcleadingsubstring, that returns the longest common leading substring of two strings, left and right. This means comparing the two strings starting from their first character. The function should return the empty string if there is no match. This function should be useful when you move on to coding part b
For example, the longest common leading substring of 'ACAGTC' and 'ACATGT' is 'ACA'. The longest common leading substring of 'ACAG' and 'CACAG' is the empty string
Complete the function in the following cell. We have provided some tests your tutor may use additional tests
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
