Interface IStack
- 
- All Known Implementing Classes:
- Stack
 
 public interface IStack
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddisplayStack()Pretty prints the stack's elements, starting from the top-most element to the bottom.voidinsertBottom(char elem)Inserts the specified element to the bottom of the stack.booleanisEmpty()Checks if the stack is empty.booleanisFull()Checks if the stack is full.intlength()Returns the length of the stack.voidmakeNull()Clears the stack.voidpop()Removes the element at the top of the stack if the stack is not empty.voidpush(char elem)Pushes a character element onto the top of the stack if there is space.chartop()Returns the element at the top of the stack, otherwise '\0' if the stack is empty.
 
- 
- 
- 
Method Detail- 
pushvoid push(char elem) Pushes a character element onto the top of the stack if there is space.- Parameters:
- elem- The character element to push onto the stack.
 
 - 
popvoid pop() Removes the element at the top of the stack if the stack is not empty.
 - 
topchar top() Returns the element at the top of the stack, otherwise '\0' if the stack is empty.- Returns:
- char
 
 - 
isEmptyboolean isEmpty() Checks if the stack is empty.- Returns:
- true if the stack is empty, false otherwise.
 
 - 
isFullboolean isFull() Checks if the stack is full.- Returns:
- true if the stack is full, false otherwise.
 
 - 
displayStackvoid displayStack() Pretty prints the stack's elements, starting from the top-most element to the bottom.
 - 
lengthint length() Returns the length of the stack.- Returns:
- int
 
 - 
makeNullvoid makeNull() Clears the stack.- Parameters:
- s- a pointer to the Stack object (struct Stack *)
 
 - 
insertBottomvoid insertBottom(char elem) Inserts the specified element to the bottom of the stack.- Parameters:
- s- a pointer to the Stack object (struct Stack *)
- elem- the element to add to the stack
 
 
- 
 
-