Explain the terms "stack" and "queue.

By vivek kumar in 20 Jul 2024 | 08:52 pm
vivek kumar

vivek kumar

Student
Posts: 552
Member since: 20 Jul 2024

Explain the terms "stack" and "queue.

20 Jul 2024 | 08:52 pm
0 Likes
Prince

Prince

Student
Posts: 557
Member since: 20 Jul 2024

Explain the terms "stack" and "queue.


Stack

A stack is a linear data structure that follows the Last In, First Out (LIFO) principle. This means the last element added to the stack will be the first one to be removed. Think of a stack like a stack of plates: you add and remove plates from the top of the stack.



Queue

A queue is a linear data structure that follows the First In, First Out (FIFO) principle. This means the first element added to the queue will be the first one to be removed. Think of a queue like a line at a ticket counter: the first person in line is the first one served.



21 Jul 2024 | 01:36 am
0 Likes

Report

Please describe about the report short and clearly.