The pop() member function determines if the stack is empty by calling the _____ member function.

Skill/Topic: Stacks using Linked List
A) removeback()
B) isEmpty()
C) removedfront()
Explanation: The pop() member function must determine if the stack is empty, or it will attempt to remove a node that isn’t on the stack. The pop() member function determines if the stack is empty by calling the isEmpty() member function, which you must define as part of the StackLinkedList class.

Showing Answers 1 - 1 of 1 Answers

sandeep yadav

  • Mar 5th, 2006
 

its only depend your way of implimentation.

but generally top of the stack is initialized by -1 and if we insert (push) an element in the stack the top first increment itself by one and on that index the number is stored and if we pop an element firat chech is the top must be greater than -1 if not the stack is empty else top return the top of the stack and decrement itself by 1.............

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions