Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java Please do the following: PLEASE DO ATLEAST UP TO TODO 4 using array // In this homework you will implement a scaled down
In Java Please do the following: PLEASE DO ATLEAST UP TO TODO 4 using array
// In this homework you will implement a scaled down version of the Java List Interface // As noted in class, Java provides two implementations of the List Interface: ArrayList:using resizable arrays -Linkedlist: using a linked list of nodes // And so this List ADT can be implemented using either a basic Java array or linked structure // Each implementation has performance advantages and disadvantages // a Simplification: The Java List interface is GENERIC; this one is NOT You are implementing a 'list' of integers int // You get to choose which of the two approaches to use / Complete all the ToDo's (in the suggested order) Some helper functions are provided for you; you are free to change/adapt/delete them however you should only do so purposefully since some of them are used in the testing framework //createFrom can be used to populate your List using data from an input array. you will need to comment-in the correct part corresponding to your implementation choice // resize() this only applies to array implementations. to use it you will need to comment-in the body of the function /print will print the list information: size and contents. /Note that the provided testing framework will not work correctly until you have completed some of the // required functions. And all testing is NOT automated; in some cases you will need to examine the output and verify // that the output is as expected. You may not use any other Java classes or algorithms in creating your solutions. public class CSC300List t // ToDo 0 // decide if you want to use: // a) linked list // b) resizing array for your container you might review all the instance methods below first; some will be easier to do depending on which container you choose. // ToDo ?.5 // choose your private data variables: comment-in the ones you want: A orB you can delete the other ones if you want // you will also want to comment-in the relevant sections in the helper functions at the bottom of the file // private Node first; / reference to the beginning of the list // static class Node [ nublic Node (int ?tem- Node next) { this. i tem = item : this. next next: }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