Unit 1 Part 2
Unit 1 Part 2
Dota yPes
Derived
User Defined Built-in
Data Type
Data Type Data Type
1Stzuct ure
2 Union Inteqra vOid floating ArYay
3. Poiter 2 function
int Chax flaat Dauble
There ore data iupes arediided inta 3 tpes.
Userdefined dat a type
2 Built-in_data type
3 Derived dota type
Properties of algorithm
Basically there aie 5 properties ar
character1Stics of the algor1thm.
Input
Output
3 finiteness
4. Definitene sSs
5 Effectivene.3S
Theseproperties aie ezplained as
Input
In put data,supplied ezternally
2. CutPut
- Result of the pIOqram
finiteness
terminates
I n eveTu coS, algorithm
af ter a finite number at Steps.
4 DefinitenesS
The Steps showd be clear
5 Pfectivene.sS
A n aLgcithm should ba witten uS ing
basic instructiong.
Tine Ond Space Compleit
There are two types of Complezity
1 Time Complexit
. Spa.ce Com plezity
8iq O notation
- The compleaity of the algori thm i s denoted
b Biq notation e.9 Ocn),OCn2) etc
Big
Stand for 'Qrder of
TimeCorm plezity
The time complezitu oan agorithm is
1Ss
tine 1equivedfor the execution of pragram
The1e are 3caseSof time complezitu
Wo1St Coase
2 AyerageCase
3 8est case
2 Space Qormplezity:
analgorithm 1S
The 9poce Complezity of
amount ot com puter memorth at S
1quie
the
aurinq the eze cution of the Proqram
w h e 1 e n i s the input
gize
notation to ezpreSSthis
-The most widely used
notatio n I t -
tunction fcn) ia theBiq
the up per bouno for the_complezty-
pYOVIdeS
9tructures:
data
On
Operations
operation.g
are pertormed
pertormed
-The
The basic five
oata Stru cture S.
on
-These operation9 ore
TraverSing
2. Sear chin9
3 Ingertion
4 Deletion
5. Sorting
1. Traversinq isaccessnq
9tructure
-TraverSing a data
acce.9.sing Only Once.
each data and
2 Searchinq- Of a data
the location
- Searchinq is findling
the q i v e n _ d a t a gtructure.
in within
3 Tnser tion data in the
is adding a new
- Inserting
data structur@
4 Deletion: the
Deletin4 is emovinq a doata f1om
d a t a StTueture.
5. Sortinq: in 90me
of data
go1ting- arIQnging
logicaorder
c) Pointers
A
pointer 1S a link or Yeferen ce to data
Structure