Data Structure Chapter 01
Data Structure Chapter 01
of Algorithms
BSIT-4th Semester (COMP4120 )
Arsalan Hussain.
Lecture - 01
Data Structures and its type’s
What are Data Structures?
Abstruct Data Type is a set of all operations that can perform on our
data structure.
Operations:
StartEngine();
DriveSmooth();
ApplyBreaks();
IsPetrolLow();
ADT Example
What is a Stack?
Value in Infix = 2 + 3 + 4
Convert it into Prefix.
Once again the same rules apply. However
we move from the outer circle to the inner
circle.
Prefix: + 2 + 3 4
Infix to Postfix Conversion
Value in Infix = 2 + 3
Convert it into Postfix.
This is just like the prefix notation, but the
operand comes at the end of the expression,
and similarly removes the need for brackets
within any expressions.
Postfix: 23+
Infix to Postfix Conversion
Value in Infix = 2 + 3 + 4
Convert it into Postfix.
Similarly when we have two expressions we
have to remember the operators to append to
the end.
Postfix: 2 3 4 + +
Assignment: