jpmcfly
March 4th, 2009, 08:24 AM
I have an examination coming up in three weeks time and having been looking through some past examination papers I have encountered a question in the previous 4 years which I am unable to answer mainly because I dont grasp what it is looking for me to do. I understand the concept of a stack as a LIFO data structures and the operations associated with it ie push / pop.
I would be very grateful if you could give me some pointers as to how I could go about answering this question as I am sure that it is something that I will encounter on my exam.
QUESTION:
--------------
An operation that displays the contents of a stack can be useful during program debugging. Write a display function such that
a. The function uses ADT stack operations; that is, it is independent of the stack’s implementation
b. The function assumes and uses the pointer-based implementation of the ADT stack
I would be very grateful if you could give me some pointers as to how I could go about answering this question as I am sure that it is something that I will encounter on my exam.
QUESTION:
--------------
An operation that displays the contents of a stack can be useful during program debugging. Write a display function such that
a. The function uses ADT stack operations; that is, it is independent of the stack’s implementation
b. The function assumes and uses the pointer-based implementation of the ADT stack