Discover the answers you need at Westonci.ca, a dynamic Q&A platform where knowledge is shared freely by a community of experts. Explore thousands of questions and answers from a knowledgeable community of experts on our user-friendly platform. Join our platform to connect with experts ready to provide precise answers to your questions in different areas.

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