5. What is the working principle of data structures stack and queues ?