Question: dna:Pls help for this programing problem in c++ (standard IO without file read/write),better with some comment about why coding that way,thanks Problem C: The DNA

dna:Pls help for this programing problem in c++ (standard IO without file read/write),better with some comment about why coding that way,thanks

dna:Pls help for this programing problem in c++ (standard IO without file

Problem C: The DNA Sequence time limit: 2 sec Problem Description DNA of a creature can be thought of as a sequence of 4 characters of A, T, C and G. Because the length of the sequence of DNA is too long to be studied, we hope to find some more important segments of the sequence. Some segments that have the maximal density of C or G are interesting to biologists but the segment can't be too short. We request you write a program to find a segment that has the most density of C or G. A substring of the string is a consecutive segment of the string. If the length of substring is L and the number of C or G is w. The CG-density of the substring is defined as wIL. The input of the program has an integer L (between 5 and 40) and a string of DNA. The program must find a substring of length at least L and the CG-density is maximal. The string of the input is less than 120 and this string consists of only A, T, C and G but mixed with upper or lower cases (e.g. ATCGatcg). Input File Format The input has several lines, the first line contains an integer which indicates the number of test cases. In each case, the first integer is L, and followed by the string of DNA. Output Format For each case, output the maximal density to three digits after decimal point. Example Sample Input: Sample Output: 833 414 5 agGCTGCAatGACAGTTGGG 20 AaggctatacagtactaatCtTtTgcatggc

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!