हिंदी

State the principle by which the stack data structure works. - Computer Science (Theory)

Advertisements
Advertisements

प्रश्न

State the principle by which the stack data structure works.

एक पंक्ति में उत्तर
Advertisements

उत्तर

Last In First Out (LIFO)

shaalaa.com
Basic Data Structures (Stack, Queue, Dequeue)
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2021-2022 (March) Set 1

संबंधित प्रश्न

What is Data Structure? 


Define:

(i) Tree

(ii) Binary Tree

(iii) Extended Binary


Explain Bubble Sort Algorithm with. suitable example.


write difference between Linear Search and Binary Search.


How linked list are represented in Memory?


Data items are divided into sub-item is called as ________.

(i) Group Item

(ii) Elementary Item

(iii) Nodes

(iv) Arrays


Write an algorithm for Traversing Linear Array.


Explain Linear data Structure and Non-linear Data Structure.


Define Group Item


Define Entity.


What is a binary tree?


With suitable example show the relationship between Total Number of Nodes and Depth of Binary Tree.


What is Record?


 ___________ 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)


 Explain memory representation of linked list with example.


A Queue is a linear data structure in which the operations are performed based on FIFO (First In First Out).

Define a class Queue with the following details:

Class name Queue
Data member/instance variable:
dat[ ] array to hold the integer elements
cap stores the maximum capacity of the queue
front to point the index of the front
rear to point the index of the rear
Member functions/methods:
Queue(int max) constructor to initialize the data member cap = max, front = rear = 0 and create the integer array
void add_dat(int v) to add integers from the rear index if possible else display the message(“Queue full”)
int pop_dat( ) to remove and return elements from front, if any, else returns -999
void display() to display elements of the queue

Specify the class Queue giving the details of void add_dat(int) and int pop_dat( ). Assume that the other functions have been defined.

The main( ) function and algorithm need NOT be written.


Differentiate between a stack and a queue.


Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×