Computer Science
What is the working principle of data structures stack and queues ?
Linear Lists
1 Like
Answer
The working principle of a stack follows the Last In First Out (LIFO) technique, where insertions and deletions occur at one end, known as the top. Elements are added to and removed from the top of the stack, allowing the most recently added item to be accessed first.
The working principle of a queue follows the First In First Out (FIFO) technique, where insertions are made at one end, known as the rear, and deletions occur at the other end, known as the front. This ensures that the oldest elements in the queue are processed first, similar to waiting in a line or queue.
Answered By
1 Like
Related Questions
What do you understand by linear and non-linear data structures ?
Name some linear data structures. Is linked list a linear data structure ?
What is a linear list data structure ? Name some operations that you can perform on linear lists.
Suggested situations where you can use these data structures:
(i) linear lists
(ii) stacks
(iii) queues