Question: with the pics below, how can I solve this question? and do I need to add something? protected final int DEFCAP =100;// default capacity protected

with the pics below,

with the pics below, how can I solve this question? and do

how can I solve this question? and do I need to add something?

I need to add something? protected final int DEFCAP =100;// default capacity

protected int origcap; // original capacity protected T[] list; // array to

hold this listas elements protected int numElements =0;// number of elements in

this list protected int currentpos; // current position for iteration // set

by find method protected boolean found; // true if element found, otherwise

false protected int location; // indicates location of element if found I

protected final int DEFCAP =100;// default capacity protected int origcap; // original capacity protected T[] list; // array to hold this listas elements protected int numElements =0;// number of elements in this list protected int currentpos; // current position for iteration // set by find method protected boolean found; // true if element found, otherwise false protected int location; // indicates location of element if found I public ArrayUnsortedList () \{ list =(T[]) new Object [DEFCAP]; origCap = DEFCAP; public ArrayUnsortedList(int origCap) \{ list =(T[]) new object[origCap]; this.origcap = origCap; \} protected void enlarge() // Increments the capacity of the list by an amoun // equal to the original capacity. 1 // Create the larger array. T[] larger =(T[]) new object[list.length + origCap]; // Copy the contents from the smaller array into the larger array. for (int i=0; i= add element \} \} for (int index = numblements; index > location; index--) 1 protected final int DEFCAP =100;// default capacity protected int origcap; // original capacity protected T[] list; // array to hold this listas elements protected int numElements =0;// number of elements in this list protected int currentpos; // current position for iteration // set by find method protected boolean found; // true if element found, otherwise false protected int location; // indicates location of element if found I public ArrayUnsortedList () \{ list =(T[]) new object [DEFCAP]; origCap = DEFCAP; \} public ArrayUnsortedList(int origCap) 1 list =(T[]) new Object[origCap]; this.origcap = origcap; protected void enlarge() // Increments the capacity of the list by an amoun // equal to the original capacity. 1 // Create the larger array. T[] larger =(T[]) new object[list.length + origCap]; I/ Copy the contents from the smaller array into the larger array. for (int i=0; i

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!