Question: NEED HELP WITH CUT-SPLICE JAVA - JAVA - JAVA - JAVA This method creates a new DnaStrand that is a clone of the current DnaStrand,
NEED HELP WITH CUT-SPLICE
JAVA - JAVA - JAVA - JAVA
This method creates a new DnaStrand that is a clone of the current DnaStrand, but with every instance of enzyme replaced by splicee. For example, if the LinkedDnaStrand is instantiated with "TTGATCC", and cutSplice("GAT", "TTAAGG") is called, then the linked list should become something like (previous pointers not shown):
first -> "TT" -> "TTAAGG" -> "CC" -> null NOTE: This method will only be called when the linked list has just one node, and it will only be called once for a DnaStrand. This means that you do not need to worry about searching for enzyme matches across node boundaries. @param enzyme is the DNA sequence to search for in this DnaStrand. @param splicee is the DNA sequence to append in place of the enzyme in the returned DnaStrand @return A new strand leaving the original strand unchanged.
This is what the method call looks like which is in my LinkedDnaStrand Class - this class implements the DnaStrand interface public DnaStrand cutSplice(String enzyme, String splicee);
This is what DnaNode looks like package dnasplicing;
public class DnaNode { public String dnaSequence; public DnaNode previous; public DnaNode next;
public DnaNode(String initialDnaSequence) { dnaSequence = initialDnaSequence; } }

After Construction: LinkedDnaStrand A LinkedDnaStrand with one DnaNode nodeCount1 first GATTACACATTACA After cutsplice("TT", "CAT") is called on the LinkedDnaStrand above: LinkedDnaStrand nodeCount 5 A new LinkedDnaStrand is returned that has 5 DnaNodes. TT is the enzyme, and CAT is the splicee in this example. first GA CAT ACACA CAT ACA For every instance of TT in the original DNA, a node with preceeding nucleotides and a node with CAT are added After Construction: LinkedDnaStrand A LinkedDnaStrand with one DnaNode nodeCount1 first GATTACACATTACA After cutsplice("TT", "CAT") is called on the LinkedDnaStrand above: LinkedDnaStrand nodeCount 5 A new LinkedDnaStrand is returned that has 5 DnaNodes. TT is the enzyme, and CAT is the splicee in this example. first GA CAT ACACA CAT ACA For every instance of TT in the original DNA, a node with preceeding nucleotides and a node with CAT are added
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
