A program to analyze gene sequences represents the genome as a very long sequenc
ID: 3757533 • Letter: A
Question
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. Each time it encounters an illegal pair of adjacent character codes, it will insert the fragment in between them, afterwards resuming the scan with the second the illegal pair.
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?
string
vector
deque
list
string
vector
deque
list
Explanation / Answer
Option 2
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.