Advertisements
Advertisements
प्रश्न
Differentiate between a stack and a queue.
Advertisements
उत्तर
| Stack | Queue | |
| 1. | The stack is based on the LIFO (Last In First Out) principle. | The queue operates on the FIFO (First In, First Out) principle. |
| 2. | Insertion Operation is called Push Operation. | The insertion operation is known as the Enqueue Operation. |
| 3. | Deletion Operation is termed Pop Operation. | The deletion operation is known as the dequeue operation. |
| 4. | Push and Pop operation occurs from one end of the stack. | Enqueue and dequeue. Operation occurs from a separate end of the line. |
| 5. | The most accessible element is termed the Top, while the least accessible element is called the Bottom of the stack. | The insertion end is termed the Rear End, while the deletion end is called the Front End. |
| 6. | Simple implementation | Compared to the stack, the implementation is more complex. |
| 7. | Only one pointer is used to perform operations. | Two pointers are used to perform operations. |
| 8. | Empty condition is checked using Top=-1 |
Empty condition is checked using Front=-1 | | Front=Rear+1. |
| 9. | Full condition is checked using Top=Max-1. |
Full condition is checked using Rear=Max-1. |
| 10. | There are no variants available for stack. | There are three sorts of variants, including circular queue, double-ended queue, and priority queue. |
| 11. | It can be regarded as a vertical collection of visuals. | Can be regarded a horizontal collection graphic. |
| 12. | Used to overcome recursive-type difficulties. | Used to tackle problems with sequential processing. |
APPEARS IN
संबंधित प्रश्न
What is Data Structure?
Define:
(i) Tree
(ii) Binary Tree
(iii) Extended Binary
Write an algorithm for the binary search method. Explain algorithm with a suitable example.
With suitable example explain how tree can be represented in Memory?
What is a linked list?
What is a Record ? How it is represented in Memory ?
Explain with flowchart the following control structure : Sequence Logic
Explain with flowchart the following control structure : Iteration Logic
Define the following term with reference to Tree:
Root
Define the following term with reference to the Tree:
Depth
Data items are divided into sub-item is called as ________.
(i) Group Item
(ii) Elementary Item
(iii) Nodes
(iv) Arrays
With suitable example show the relationship between Total Number of Nodes and Depth of Binary Tree.
___________ is very useful in situation when data is to be stored and retrieved in reverse order.
Explain Binary Scarch algorithm with a suitable example.
What is Binary Tree ? Draw the Tree diagram for the expression.
B = (3R -5T)2 - (R + Q3)
Write two features of each of doto structures:
1) Record
2) Linear array
3) Linked list
Explain memory representation of linked list with example.
