1) Write a method for an array-based implementation of the Listclass that remove
ID: 3610665 • Letter: 1
Question
1) Write a method for an array-based implementation of the Listclass that removes the largest item in the list. Do no useany other methods from the List class. Assume thatNodeItemType as a > operator. Draw (a very brief sketch)of an example of the use of this method.----
So far I have:
int largest = 0;
for (int i = 0; i < SIZE; i++)
{
if (items [i] > items [largest]
largest =i;
}
So I have how to find the largest item in the array, I am just notsure how I would delete that item for an array. I am also notsure on what a sketch of this would look like, if anyone can helpit would be much appreciated! Thanks!
Explanation / Answer
int largest = 0; for (int i = 0; i items [largest]) largest =i; } for (int i = largest; iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.