Question: Assume that language SL includes a stack data structure and three operations: NewTop(S,E) which adds the element E to the top stack S, popTop(S), which
Assume that language SL includes a stack data structure and three operations: NewTop(S,E) which adds the element E to the top stack S, popTop(S), which deletes the top element of the stack S, GetTop(S) which returns a pointer to the location in stack S of the current top element. What is wrong with the design of these three operations? How could they be redefined to correct the problem?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
