Write the functions initialize, push, top, pop, and liststack to maintain a global stack. These functions should behave: > (initialize) nil > (push ‘foo) foo > (push ‘bar) bar > (top) bar >...


Write the functions initialize, push, top, pop, and liststack to maintain a global stack. These functions should behave:


> (initialize) nil


> (push ‘foo)


foo


> (push ‘bar)


bar


> (top)


bar


> (list-stack)


(bar foo)


> (pop)


bar


> (list-stack)


(foo)


> (pop)


foo


> (list-stack)


()



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here