The Stack Abstract Data Type • A stack is an abstract data type (ADT) that supports two main methods: - push(o): Inserts object o onto top of stack Input: Object; Output: none - pop(): Removes the top object of stack and returns it; if stack is empty an error occurs Input: none; Output: Object • The following support methods should also be defined: - size(): Returns the number of objects in stack Input: none; Output: integer - isEmpty(): Return a boolean indicating if stack is empty. Input: none; Output: boolean - top(): return the top object of the stack, without removing it; if the stack is empty an error occurs. Input: none; Output: Object - Study24x7
Social learning Network

Warning: include(./views/auth.php): failed to open stream: Permission denied in /var/www/html/live/loginRightSlider.php on line 18

Warning: include(): Failed opening './views/auth.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/live/loginRightSlider.php on line 18
16 Mar 2019 10:29 AM study24x7 study24x7

The Stack Abstract Data Type • A stack is an abstract data type (ADT) that supports two main methods: - push(o): Inserts object o onto top of stack Input: Object; Output: none - pop(): Removes the top object of stack and returns it; if stack is empty an error occurs Input: none...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles