hi guys, i have 2 questions about stacks and queues. i found some hints about them from here but i can't write programs these are the following questions. please help me to write these short programs..
Stacks Please write a short program that reads one after the other a the characters ’C’,
’O’, ’M’, ’P’, U’, ’T’, ’E’, ’R’ from the command line and pushes it to the stack of
characters with the name x. Then apply the operations top and pop and print the
popped elements on the screen. Test if the program runs for both the contiguous
implementation of stacks, as well as the linked implementation.
Queues Please write a short program to test the behavior of the queue implementations,
therefore please create a queue of integers of size 5. Append 1,2,3,4,5 to the queue,
then apply 10 Append and serve operations indicating if the append or serve was
successful. Test this short program for linear and physical implementation. What
is the difference?