0% found this document useful (0 votes)
20 views4 pages

Chap-7 Data Structures

The document discusses data structures, focusing on stacks and their operations, such as pushing and popping elements. It includes multiple choice questions, fill-in-the-blank exercises, and true/false statements related to data structures. Additionally, it covers concepts like linear and non-linear structures, as well as the differences between stacks and queues.

Uploaded by

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

Chap-7 Data Structures

The document discusses data structures, focusing on stacks and their operations, such as pushing and popping elements. It includes multiple choice questions, fill-in-the-blank exercises, and true/false statements related to data structures. Additionally, it covers concepts like linear and non-linear structures, as well as the differences between stacks and queues.

Uploaded by

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

LETUS REVISE

unit.
Adata
structure is a named group of data of different data types which can be processed as asingle
primitive data types.
Simpledata structures are normally built from
to form compound data structures. The compound data
. Gimple data structures can be combined in various ways
structures may be linear (whose
elements form a sequence) and non-linear (which are multi-level).
deletions take
Astack is a linear structure implemented in
LIFO (Last In First Out) manner where insertions and
stack's top.
place only at one end i.e., the
An insertion in a stack is called pushing and a deletion from a stack is called popping.
A accommodated, it is called an
implemented as an array, is full and no new element can be
&When a stack,
OVERFLOW. UNDERFLOW.
and an element's deletion is tried from the stack, it is called an
When a stack is empty either before its operands (this form is
the operator symbol is placed
Polish string refers to the notation in which (this form is called postfix notation). The usual form, in which the
operands
called prefix notation) or after its operands, is called infix notation.
operator is placed in between the
OTQS
OBJECTIVE TYPE QUESTIONS
MULTIPLE CHOICE QUESTIONS

of the following Python code ?


1. What willbe the output
a= [10, 23,56, [78, 10]]
b list(a)
a[31[e)+» 17
print (b)
[10,23,56,[95, 10]] (d) [10,34,71,[78, 10)]
(9) [10,23,71,(95,10]] (b) [10,23,56,
[78, 25]) (c)
code ?
the following Python
2 What will be the output of
lsti = "hello"
(x.upper(), len(x)) for xin lst1 )
lst2 =list(
print(1st2) (b) [(HELLO', 5)]
(H, 1), (E', 1), (L, 1), (L', 1), ('O, 1)] (d) Syntax error
(9)
T(H, 5), ('E', 5), (L', 5), (L, 5), ('O, 5)]
(0)
300 COMPUTER SCIENCE
WITH
3. What will be the output of the following Python code ? PY THON -A
Ist = (3, 4,6, 1,2]
lst [1:2] = (7,8]
print(1st)
(a) (3, 7, 8, 6, 1, 2] (b) Syntax error
4.
(c) (3, [7, 8], 6, 1,2] (d) (3, 4, 6, 7, 8]
Data structure stack is also known as list.
(a) First In First Out (b) First In Last Out
(c) Last In First Cut
(d) All of these
5. Data structure Oueue is also
known as list.
(a) First In First Out
(b) First In Last Out
(c) Last In First Out
(d) All of these
6. In a stack, all
insertions take place at end(s).
(a) top (b) front (c) rear
7. In a stack, deletions take (d) any
place at end.
(a) front
(6) top (c) rear (d) any
8. The terms Push and Pop are related to
(a) Queue (b) Stack (c) Both (d) None
9. Choose correct output for the
following sequence of operations (" signifies top).
push(5), push(8), pop, push(2), push(5), pop,
(a) 8 5 251
push(1)
(b) 8 55 21 (c) 2551
10. form of access is used to (d) 5 2 1
(a) LIFO
add/remove nodes from a stack.
(b) FIFO (c) Both (a) and (b)
11. Stack follows the (d) None of these
strategy of
(a) LIFO (b) FIFO (c) LRU
12. Which of the (d) RANDOM
following is an application of stack ?
(a) Finding factorial
(c) Infix to postfix (b) Reversing of a string
(d) All of the above
13. When a stack,
implemented as an
accommodated, it is called an array/list of fixed size, is full and
no new element can be
(a) OVERFLOW (b) UNDERFLOW (c) EXTRAFLOW
14. When a stack is empty and (d) NOFLOW
an element's deletion is tried from the stack, it is
(a) OVERFLOW (b) UNDERFLOW called an
(c) EXTRAFLOW (d) NOFLOW
15. Pushing an element into stack already
OCcurS. having five elements and stack has fixed
size of 5, then
(a) Overflow
(b) Crash (c) Underflow (d) User flow
FILL IN THE BLANKS
1. A is a named group of data of
2. In
., each element of the list is
different data types which can be processed as a
3. A stack is a compared with the given item to be reached for, single u
linear structure
implemented in LIFO ( one-by-one
) manner.
DAATA STRUCTURES 301
Chopter 7:

Thetechnical terms for insertion-in-a-stack and deletion-from-stack are and respectively.


t.

5.
refers to a situation (ERROR)when one tries to engueue/insert an item in a stack that is u
6.
refers to a situation (ERROR) when one tries to dequeue/delete an item from an empy sa
TRUE/FALSE QUESTIONS
1 Stacks can be implemented using lists.
end and
2. Lists
where controlled insertions and deletions take place such that insertions at the rear
deletions from the front end, are queues.
, Push and Pop are terms related to stack data structure.
implemented through stacks.
4 The postix conversion of an infix expression and recursion are internally
5 Pushing in afull fixed size stack results into an error.
6. Popping from an empty stack results into an error.
AsSERTIONS AND REASONS

DIRECTIONS
followed by a statement of Reason (R).
In the following questions, a statement of Assertion (A) is
Mark the correct choice as:
(a) Both A and R are true and R is the correct explanation of A.
explanation of A.
(b) Both A and R are true but R is not the correct
(c) Ais true but R is false (or partly true).
(e) Both A and R are false or not fully true.
(d) A is false (or partly true) but R is true.
elements.
named list of finite number of similar data
1. Assertion. A linear list refers to a
under one name make a linear list.
Reason. Similar type of elements grouped
list.
2. Assertion. A list having one or
more lists as its elements is called a nested
structure such as dictionaries or tuples, create
Reason. Two or more lists as part of another data
nested lists.
structure implemented in LIFO manner.
3. Assertion. A stack is a linear data elements
In stacks, the elements are processed in the reverse order of their insertion - the
Reason.
inserted lasts, are removed first.
LIFO structure.
4. Assertion (A), A stack is a
new element pushed into the stack always gets positioned at the index after the
Reason (R). Any [CBSE D 23]
last existing element in the stack.
structure implemented in FIFO manner.
5. Assertion. A queue is a linear data removal takes place at the front end.
rear end and the
Reason. In a queue, insertion takesplace at the manner.
Assertion. A stack is implemented in LIFO manner and a queue is implemented in FIFO
6.
manner through a special method.
Reason. A stack can be implemented in FIFO
storing and evaluating expressions.
7. Assertion. Stacks have found their applications in postfix
Reason. Postfix form of expression can be created using stacks and for evaluating
expressions also, the stacks are used.
NOTE given at the end of the book.
CHAPTER 7: DATA STRUCTURES
Multiple Choice Questions
1. (c) 2. (a) 3. (a) 4. (b) and (c) 5. (a) 6. (a)
7. (b) 8. (b) 9. (d) 10. (a) 11. (a) 12. (d)
13. (a) 14. (6) 15. (a)
Fill in the Blanks
1. datastructure 2. linear search 3. Last In First Out

4. Push, Pop 5. Overflow 6. Underflow

True/False Questions
1. T 2. T 3. T 4. T 5. T 6. T

Assertions and Reasons


1. (a) 2. (b) 3. (a) 4. (a) 5. (b) 6. (c)
7. (a)
CHAPTER 8 : Co PUTFR

You might also like