Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
236 views
in Data Structures and Operations by (30.9k points)
closed by

Class teacher said to the class leader to collecting their observation books and place them in a table one by one. Teacher should take books one by one from this group always from the top. Suppose that books be arranged in linear form from bottom to top

1. In which position a new book can be placed? 

2. How can a book be taken from this group? 

3. Which operations are performed for this purpose? 

4. Write all steps for adding new books to this group or 

5. Write all steps for removing books one by one from this group.

1 Answer

+1 vote
by (31.4k points)
selected by
 
Best answer

1. At the top 

2. From the top. 

3. To place a new book it is push operation and taking books from the stack is pop operation 

4.

Step 1: If top = Null. Then print “UNDERFLOW” and return 

Step 2: Set item = Stack[top]

Step 3: Set-top = top – 1 

Step 4: stop

5.

Step 1: If front = 1 and rear=N or front =rear+1. Then print “OVERFLOW and return” 

Step 2: If front = Null then Set front = 1 and rear =1 Else if rear = N then set rear = 1 Else Set rear = rear + 1 End if

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...