Question: Please solve using JAVA as soon as possible and show the OUTPUT! Thanks in advance Below is Linked list client code: //************************************************************************ ******* // FILE

Please solve using JAVA as soon as possible and show the OUTPUT!

Thanks in advance

Please solve using JAVA as soon as possible and show the OUTPUT!

Below is Linked list client code:

//************************************************************************

*******

// FILE NAME : LLIntcollTest.java

// DESCRIPTION : This file tests Intcoll4 - the linked list version of

Intcoll.

//************************************************************************

*******

import java.util.*;

import java.io.*;

public class LLIntcollTest

{

public static void main(String[] args)

{

System.out.println("Enter # of random integers to be generated");

Scanner blackboard=new Scanner(System.in);

int n=blackboard.nextInt();

Intcoll4 LL=new Intcoll4(n);

Random gen=new Random(); long lapse=0, begin, end; int k=0;

while (k

{

int i=5*(gen.nextInt(n)+1);

begin=System.currentTimeMillis();

LL.insert(i);

end=System.currentTimeMillis();

lapse=lapse+(end-begin);

k++;

}

System.out.println("The # of integers in LL is "+LL.get_howmany());

System.out.println("Time in milliseconds "+lapse);

}

}

Create intcoll4 and run our intcoll4client using intcoll4. In this 4th version, intcoll4, the integers in a collection are stored in a linked list whose name is the private member o (using the inner class ListNode). Also, how many is still a private member. // The inner class for ListNode private class ListNode private int info; private ListNode link; public ListNode) info-0; link null public ListNode(int i, ListNode p) \info-i; link -p:)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!