Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Note* Please do exercise 5. Ex\'s 2&4are listed for reference. Thank you! Exerci

ID: 3614961 • Letter: N

Question

Note*   Please do exercise 5.   Ex's 2&4are listed for reference. Thank you!


Exercise 5:
Write the implementation of the DeleteAll functionas described in Exercise 4.


Exercise 4:
We would like to add a DeleteAll function to theList type from Ex. 2 that depletes all occurrencesof an item from a list. Write the code that must be added tothe specification file for the type to enable us to add thisfunction.

Exercise 2:
The List type in this chapter allows us to storeonly one copy of an item in the list. Sometimes it is useful tohave a list in which an item can appear any number of times. Changethe implementation of the Insert function so thatit adds an item to the list any time it is inserted.

Explanation / Answer


void ::List DeleteAll() { int i; for(i = 0;i<MAX_LENGTH;i++) data[i] = -1;
length =0; currentPos= -1; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote