Tuesday, April 15, 2008

Stack:
Stack is a important data structure In Perl programming, and can be implemented using LIFO technique. i.e., the Last thing In is the First thing Out. So from the above demonstration(refer Figure 1.1), it's learnt that Stacks can be implemented using PUSH and POP commands.

Queue:
The queue is another data structure. A physical analogy for a queue is a line at a bank. When you go to the bank, customers go to the rear (end) of the line and customers come off of the line (i.e., are serviced) from the front of the line. So from the above demonstration(refer Figure 1.1), we can say that Queues can be implemented using PUSH and SHIFT.

No comments: