Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.util. * ; public class LookupMultipleNumber { public static void main ( String [ ] args ) { Scanner in = new Scanner (
import java.util.;
public class LookupMultipleNumber
public static void mainString args
Scanner in new ScannerSystemin; Use Scanner for standard input
int maxRes Integer.parseIntargs;
int keyField Integer.parseIntargs;
int valField Integer.parseIntargs;
Map map new LinkedHashMap;
while inhasNextLine
String line innextLine;
String tokens line.split;
String key tokenskeyField;
String val tokensvalField;
map.putIfAbsentkey new LinkedList;
map.getkeyaddval; Use add for Queue
Scanner stdin new ScannerSystemin; New Scanner for standard input
while stdinhasNext
String s stdin.next;
if map.containsKeys
System.out.printlnnull;
else
int i ;
for String value : map.gets
System.out.printvalue ;
i;
if i maxRes
break;
System.out.println;
inclose;
stdin.close;
MSample runs would be as follows refer to input file amino.csv
java LookupMultipleNumber amino.csv
Tryptophan
TGG
Cysteine
TGT TGC
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