Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

define EFFECTIVE PARTICIPATION

Answered: 1 week ago