Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: Data structures class 12 computer science
Description: All information regarding data structures like stack and queue and the programs

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


As per Term
wise
Syllabus
2021-22

Chapter 4
Data-structures:
stack

Computer Science
Class XII ( As per CBSE Board)
Visit : python
...
in for regular updates

Data-structures
It a way of organizing and storing data in such a manner so that it can be accessed
and work over it can be done efficiently and less resources are required
...
There are many
various types of data structures defined that make it easier for the computer
programmer,to concentrate on the main problems rather than getting lost in the
details of data description and access
...
mykvs
...

Index of first item is 0 and the last item is n-1
...

Indexing of list

Creating a list
Lists are enclosed in square brackets [ ] and each item is separated by a comma
...
g
...
mykvs
...

e
...

list =[3,5,9]
3
print(list[0])
5
print(list[1])
9
print(list[2])
output Negative indexing
print('Negative indexing')
9
5
print(list[-1])
3
print(list[-2])
print(list[-3])
Visit : python
...
in for regular updates

Data-structures

Iterating Through A List
List elements can be accessed using looping statement
...
g
...
mykvs
...
append()
list
...
insert()
list
...
clear()
list
...
index()
list
...
reverse()
len(list)
max(list)
min(list)

Description
Add an Item at end of a list
Add multiple Items at end of a list
insert an Item at a defined index
remove an Item from a list
Delete an Item from a list
empty all the list
Remove an Item at a defined index
Return index of first matched item
Sort the items of a list in ascending or descending order
Reverse the items of a list
Return total length of the list
...

Return item with min value in the list
...


For detail on list click here
Visit : python
...
in for regular updates

Data-structures
Stack:
A stack is a linear data structure in which all the insertion and
deletion of data / values are done at one end only
...

➢ It follows LIFO(Last In First Out)
property
...

➢ Insertion in stack is also known as
a PUSH operation
...

Visit : python
...
in for regular updates

Data-structures
Applications of Stack:
• Expression Evaluation: It is used to evaluate prefix, postfix and infix
expressions
...

• Syntax Parsing: Many compilers use a stack for parsing the syntax of
expressions
...

• Parenthesis Checking: Stack is used to check the proper opening
and closing of parenthesis
...

• Function Call: Stack is used to keep information about the active
functions or subroutines
...
mykvs
...
By Using these functions make
the code short and simple for stack implementation
...
e
...
These functions work quiet efficiently
and fast in end operations
...
mykvs
...
g
...
append(7)
stack
...
pop())
print(stack)
print(stack
...
mykvs
...
items = []
def is_empty(self):
return self
...
items
...
items
...
push(n)
elif do == 2:
if s
...
')
else:
print('Popped value: ', s
...
mykvs
Title: Data structures class 12 computer science
Description: All information regarding data structures like stack and queue and the programs