Answered step by step
Verified Expert Solution
Question
1 Approved Answer
GenesCount / Do not add any imports. / / ( You shouldn't need any, and you'll fail the autograder if you do . ) import
GenesCount
Do not add any imports.
You shouldn't need any, and you'll fail the autograder if you do
import input.InputGenerator;
import input.FileCharGenerator;
import input.AlternatingCharGenerator;
import ods.ArrayDeque;
import ods.ArrayQueue;
import ods.ArrayStack;
import ods.RootishArrayStack;
import ods.SLList;
import ods.DLList;
import ods.SEList;
import ods.SkiplistList;
import ods.SkiplistSSet;
import ods.BinaryTree;
import ods.BinarySearchTree;
import ods.Treap;
import ods.ScapegoatTree;
import ods.SSet;
import ods.RedBlackTree;
import ods.MultiplicativeHashSet;
import java.util.ListIterator;
import java.util.Iterator;
import java.util.AbstractSet;
import java.util.HashSet;
import java.util.HashMap;
import java.util.Collections;
import java.util.Comparator;
import java.util.AbstractList;
import java.util.Map;
public class GenesCount
public static AbstractList genesCountInputGenerator gen, int k
TODOstudent: Your code goes here
while gen.hasNext This loops through the entire input
Character c gen.next;
return null;
These are a few examples of how to use the InputGenerator to run local tests
You should test more extensively than this.
public static void mainString args
System.out.printlnTesting genesCount via GenesCount.main...";
System.out.printlnThese are limited local tests; please add more tests of your own!";
System.out.printlnYou should also try testing via testsGenesCountTestjava";
InputGenerator gen new FileCharGenerator;
The following tests genes using the chars in the
file samplesgenessample.txt up to the first newline.
gen new FileCharGenerator "samplesgenesCountsample.txt;
System.out.println "Expect tACG UAC, AUC, CCU, CGA, CUA, GAU, UCC:
t genesCountgen; Expect ACG AUC, CCU, CGA, CUA, GAU, UAC, UCC
If you want to test via the commandline, ie if you want to input a stream of
characters of your own devising and then run genesCount once you hit 'Enter', then
uncomment the next three lines.
gen new FileCharGenerator;
Systemout.println "Enter a sequence of characters, then hit Enter to run genesCountgen:;
Systemout.println "Your result is: genesCountgen;
The following tests use a generate that alternates between the characters listed in the
options array. The second argument is the number of characters to generate.
char options AUCG;
gen new AlternatingCharGeneratoroptions; Generates AUCGAUCGAUCG
System.out.println "Expect AUCG CGAU, GAUC, UCGA: genesCountgen; Expect AUCG CGAU, GAUC, UCGA
gen new AlternatingCharGeneratoroptions true; Generates AUCGAUCGAU uses true to store what was generated
System.out.println "Expect AUCGAUCGA UCGAUCGAU: genesCountgen; Expect AUCGAUCGA UCGAUCGAU
gen new AlternatingCharGeneratoroptions true; Generates AUCGAUCGAUC uses true to store what was generated
System.out.println "Expect AUC CGA, GAU, UCG: genesCountgen; Expect AUC CGA, GAU, UCG
gen new AlternatingCharGeneratoroptions true; Generates AUCGAUCGAUC uses true to store what was generated
System.out.println "Expect A C U G: genesCountgen; Expect A C U G
gen new AlternatingCharGeneratoroptions true; Generates AUCGAUCGAUC uses true to store what was generated
System.out.println "Expect : genesCountgen; Expect
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