List three assumptions that need to be made when inserting and removing items from an array. What happens when any of the assumptions is not met?

What will be an ideal response?

There are four assumptions:
1. Arrays are of fixed size; thus, when an array becomes full, insertions are not performed.
2. We are working with an array of objects, although we can modify the code to cover arrays of integers, employees, or whatever element type is desired.
3. For successful insertions, 0 <= target index <= logical size. The new element is inserted before the element currently at the target index, or after the last element if the target index equals the logical size.
4. For successful removals, 0 <= target index < logical size.

When an assumption is not satisfied, the operation is not performed and we return false;
otherwise, the operation is performed and we return true.

Computer Science & Information Technology

You might also like to view...

A PowerPoint presentation can be saved as a Web page and posted to the World Wide Web

Indicate whether the statement is true or false

Computer Science & Information Technology

The _____________ provides explicit policy guidance for a project, and establishes priorities that determine the application of resources for treatment.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology