Question: java I have an array of type node that has 5 elements, Node [] array = new Node [5]; I have also created a header

java

I have an array of type node that has 5 elements, Node [] array = new Node [5];

I have also created a header node for each index in the array that has an integer field of 0. (element of array points to a header)

It looks like this

index header value

0 --> 0

1 --> 0

2 -> 0

3 --> 0

4 --> 0

I want to add items in the value column randomly, which is done by picking a random index (0-4) and adding a random value in that linked list. How would this be implemented?

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!