Can anyone expalin what is different between Queue and stack.
Why in this example of queue they didnt use function front.
In my understanding the difference between the stack and queue is queue have front while stack have top.
Is this true?
No my friend abeginner23235616. I'm malaysian that still in studies of programming. Nice to meet you.
Actually my exam also just around the corner. Hope you can help me too.
A queue and a stack are both data structures which hold multiple elements of the same type. With a queue, the first element to be added is the first that can be removed. In a stack, the last element that was put in is the first element that can be removed. So a queue is First In, First Out, while a stack is Last In, First Out.