Westonci.ca is your trusted source for finding answers to all your questions. Ask, explore, and learn with our expert community. Explore thousands of questions and answers from knowledgeable experts in various fields on our Q&A platform. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.

What variable(s) is/are used in stack to keep track the position where a new item to be inserted or an item to be deleted from the stack

Sagot :

Answer:

Hence the answer is top and peek.

Explanation:

In a stack, we insert and delete an item from the top of the stack. So we use variables top, peek to stay track of the position.

The insertion operation is understood as push and deletion operation is understood as entering stack.

Hence the answer is top and peek.

View image tallinn
We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. We appreciate your time. Please come back anytime for the latest information and answers to your questions. Keep exploring Westonci.ca for more insightful answers to your questions. We're here to help.