A linear data structure is one in which each element has a unique predecessor and a unique successor. There will at most one element without a predecessor (the first) and at most one element without a successor (the last). A stack is a linear data structure in which insertions and deletions are done at one end. The end where the insertions and deletions take place is called the top. An insertion into a stack is called a push, and a deletion is called a pop. The ADT of a stack is: Members: A list of items with a position top that indicates the top of the stack, where insertions and deletions are to be done. Methods: Constructor: Input: None Precondition: int Process: Initialize the top of the stack so that it is empty. Set the value of size to be the passed value, and create an array of that size. Output: None Postcondition: The stack is now empty. StackEmpty: Input: None Precondition: None Process: Check whether the stack is empty. Output: Return TRUE is the stack is empty, FALSE otherwise. Postcondition: None StackFull: Input: None Precondition: None Process: Check whether the stack is full. Output: Return TRUE is the stack is full, FALSE otherwise. Postcondition: None Pop: Input: None Precondition: Stack is not empty. Process; Remove the item from the top of the stack. Output: Return the element from the top of the stack. Postcondition: Element at the top of they stack is removed Push: Input: An item for the stack. Precondition: Stack is not full. Process: Store the item on the top of the stack. Output: None. Postcondition: The stack has a new element at the top. Peek: Input: none Precondition: Stack is not empty. Process: Retrieve the value of the item at the top of the stack. Output: Return the value at the top of the stack. Postcondition: none Search: Precondition: none Input: An item to be searched for Process: Search the stack for the item. If it is at the top of the stack return 1, the second item on the stack, return 2, etc. If it is not in the stack, return -1. Output: int, the relative position in the stack. Postcondition: none Note: The implementation of a stack in java.util.Stack does not have a method of StackFull.