0

I need to change from Pseudo code to java code

Here is some pseudocode for the main routine: Prompt the user for the input file name and verbosity (see above) Instantiate the DList as dList. Read the first input from the file (it will be a string, use Integer.parseInt() to convert it to an Integer). Set a BNode reference, aux, to the reference returned by a call to the BNode<Integer> constructor passing in the input object. Use the dList methods setFirst, setMid, and setLast, to make aux the first node in the list. While the input file hasNext() Read the next input and convert it to an Integer Set aux as above If aux.compareTo(dList.getFirst()) < 0, then call dList.newFirst(aux) Else if aux,compareTo(dList.getLast() > 0, then call dList.newLast(aux) Else call dList.newInside(aux) (see below for more pseudocode) End If … Else Call dList.prDList() (after step 4 above this will go to a file if verbose = true) End While Close input file Output the FINAL dList, or If verbose = true, flush and close the output file

12th Oct 2020, 4:45 AM
Basel Kaskas
1 Antwort
0
.
31st Oct 2020, 5:20 PM
ALLY MAFTAH
ALLY MAFTAH - avatar