Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions