0% found this document useful (0 votes)
69 views2 pages

All Saints School, Agra: General Instructions

This document contains instructions and questions for a periodic test in Computer Science for Class 12. There are 9 multiple choice questions about stacks and their operations like push and pop. There are 7 short answer type questions about data structures, stacks, functions to add and remove elements from a stack, outcomes of code samples using stacks and lists, properties of a movie details database table like primary key and candidate keys. Students are asked to write a Python program with menu driven choices to demonstrate stack operations using lists and functions.

Uploaded by

Shesh Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views2 pages

All Saints School, Agra: General Instructions

This document contains instructions and questions for a periodic test in Computer Science for Class 12. There are 9 multiple choice questions about stacks and their operations like push and pop. There are 7 short answer type questions about data structures, stacks, functions to add and remove elements from a stack, outcomes of code samples using stacks and lists, properties of a movie details database table like primary key and candidate keys. Students are asked to write a Python program with menu driven choices to demonstrate stack operations using lists and functions.

Uploaded by

Shesh Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

All Saints School, Agra

Periodic Test-4
Session: 2021-22
Sub: Computer Science (083)
Class: XII
Date:
Time: 1 Hour M.M: 30

General instructions:
● All questions are compulsory.

Multiple choice questions: (1*9= 9 marks)


1. Stack data structure is also known as ___________ list.
(a) FIFO (b) LIFO (c) FILO (d) FOLI
2. In a stack, all insertions take place at _______ end.
(a) top (b) front (c) rear (d) any
3. In a stack, deletions take place at _______ end.
(a) front (b) top (c) rear (d) any
4. Terms push and pop are related to _________.
(a) queue (b) stack (c) both (d) none
5. Choose the correct output for the following sequence of operations (• signifies top).
push(5), push(8), pop, push(2), push(5), pop, push(1)
(a) 8 5 2 5 1 (b) 8 5 5 2 1 (c) 2 5 5 1 (d) 5 2 1
• •
6. If a user •tries to remove an element from• empty stack, it is called ________________.
(a) underflow (b) overflow (c) empty collection (d) garbage collection
7. Process of inserting an element in stack is called ____________
(a) create (b) push (c) evaluation (d) pop
8. Process of removing an element from stack is called __________
(a) create (b) push (c) evaluation (d) pop
9. Entries in a stack are “ordered”. What is the meaning of this statement?
(a) A collection of stacks is sortable (c) The entries are stored in a linked list
(b) Stack entries may be compared with the ‘<’ (d) There is a Sequential entry that is one by one

Short answer type questions: (3*7= 21 marks)


11. What is data structure? Explain with examples.

12. Compare a data type with a data structure. Explain with examples.

13. What is a stack? Which basic operations can be performed on it?

14. Write Addnew(Book) and Remove(Book) functions in Python to add a new book and remove a book from the
stack of books, considering them to act as PUSH and POP operations of the stack data structure. Some instructions are
as follows:
Name of the stack is ‘BookData’ and ‘Book’ is the name of the element to be pushed and popped.

15. What will be the outcome of the following code:


result=0
numberList=[10,20,30,90,5]
numberList.append(40)
result=result+numberList.pop()
result=result+numberList.pop()
print('Result=',result)
answer=[]
output=''
answer.append('T')
answer.append('A')
answer.append('M')
ch=answer.pop()
output=output+ch
ch=answer.pop()
output=output+ch
ch=answer.pop()
output=output+ch
print('Result=',output)

16. Consider the table, MOVIEDETAILS given below:


Table: MOVIEDETAILS
MOVIEID TITLE LANGUAGE RATING PLATFORM
M001 Minari Korean 3 Netflix
M002 MGR magan Tamil 4 Hotstar
M003 Kagaz Hindi 5 Zee5
M004 Uri Hindi 5 Prime Video
(a). Identify the degree and cardinality of the table.
(b). Which field should be made the primary key? Justify your answer.
(c). Identify the candidate key(s) from the table MOVIEDETAILS.

17. WAP in python using menu driven choices to perform push, pop and show operations to demonstrate stack
operations using list data type. Use user-defined functions for the same.

You might also like