Ds First & Second Unit Aug 2020
Ds First & Second Unit Aug 2020
Data
Structure
Non-
Primitive
Primitive
Integer, Array,
Character
Float List,File
Lists
Non-
Linear
Linear
Tree,
Stack Queue
Graph
List
Queue
Stack
Update operation
The update operation update on modifies the
data in the data structure.
A[3][3]= 1 2 3
4 5 6
5 7 7
3*3
Mat[3][3] = 1 0 0
0 1 0
0 0 1 3*3
Mat[3][3] = 1 1 0
5 2 4
0 6 3
3*3
Mat[3][3] = 1 0 0
3 5 0
6 7 1 3*3
Mat = 1 5 3
0 5 2
0 0 7 3*3
for example
Example: mat[4][4];
0 0 3 0 4
0 0 5 7 0
0 0 0 0 0
0 2 6 0 0 4*4
• Array representation
•Linked list representation
Method 1: Using Arrays
In linked list, each node has four fields. These four fields are
defined as:
Row: Index of row, where non-zero element is located
TOP
D
E
D D D
C C C C C
B B B B B
A A A A A
D
TOP
-1 Empty
0 Only one element in the
stack
Dr. Sanjeev Tayal (HOD) BCA & B.Sc(C.S) N-1 Stack is full
There are various type of notation for writing
mathematical expressions . First of all we will
consider the following set of operations.
Symbol Operation Perform Precedence
^ Exponentation Highest
* Multiplication Highest
/ Divison Highest
% Modulus Highest
+ Addition Lowest
- Subtraction Lowest
(A*B+(C/D))-F A/(B^C)-D
(*AB+(/CD))-F A/(^BC)-D
(+*AB/CD)-F /A^BC-D
-+*AB/CDF -/A^BCD
Step6.Exit