PART I: Short Response
Directions: Answer each of the following questions. Please ensure that your responses are at least 3 to 5 sentences in length.
1. What is meant by the last-in, first-out (LIFO) property?
2. What is the difference between the stack pop and getTop operations?
3. In a program that uses a stack to check for balanced braces in an string, what condition indicates that the braces are balanced when the end of the string is reached?
4. When does the push operation throw a StackException?
5. What restriction does the array-based implementation of a stack place on the push operation?
PART II
Define the exception class MemoryAllocationException and then revise the definition of the method push in the class LinkedStack so that it throws this exception if it cannot allocate a new node.