Question
Please provide explanation for each part. Thank You. Part A) Select any answers that apply. A program to analyze gene sequences represents the genome as
Please provide explanation for each part. Thank You.
Part A) Select any answers that apply.
A program to analyze gene sequences represents the genome as a very long sequence of characters. For the sake of this problem, assume that certain character combinations cannot occur legally next to one another.
A function in this program will take as parameters that long sequence (the "target") and another somewhat shorter sequence (the "fragment"). It will scan sequentially though the target sequence looking for the first illegal pair of adjacent character codes. It must then update the target by inserting the fragment between those two codes.
We want this function to run in O(n) time where n is the length of the target sequence. Which of the following containers would be acceptable candidates for storing these sequences?
a-string | ||
b-vector | ||
c-deque | ||
d-list
Part B) If you wished to write a function to determine how many negative integers are in a list, without using any loops or recursion, which std function template would you employ?
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started