Question: The class random _ generator has been updated ( random _ generator.h and ran - dom _ generator.cc ) by a member function which generates

The class random_generator has been updated (random_generator.h and ran-
dom_generator.cc) by a member function which generates random strings of a fixed
length using the a given number of characters from the alphabet, starting with "a".
char* random_string_m(int n, int no_ch)
The function allocates n+1 characters. The first n characters (0dotsn-1)
are chosen at random using the first no_ch characters from the alphabet start-
ing with "a"(e.g., for no_ch =4 the characters are randomly chosen out of
{a,b,c,d}. The n-th character is set to 0 in order to mark the end
of the string.
Dynamic programming (70 points)
The dynamic programming Smith-Waterman algorithm is matching sequences recur-
sively defined as follows, given x=x1,dots,xn(along table rows) and Y=y1,dots,ym
(along table columns).
M(i,0)=0, for all 0in
M(0,j)=0, for all 0jm
M(i,j)=max{M(i-1,j-1)+2ifxi=yj
M(i-1,j-1)-1ifxiyj
M(i-1,j)-1if-is inserted into Y
M(i,j-1)-1if-is inserted into x
The function M(i,j) defines a so called matching score for the partial sequences xi
and Yj. If in the recursive definition of M the maximum value is due to the third
or fourth line, you have to insert the character "-" into either x or Y in order to
reconstruct the matching sequences x' and Y'. Similar to the LCS problem we need
only need a table to store the M(i,j) values, but an additional table that allows us
to later generate x' and Y' from x and Y.
 The class random_generator has been updated (random_generator.h and ran- dom_generator.cc) by

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!