0% found this document useful (0 votes)
33 views5 pages

Unit 1 Part 2

The document discusses different types of data in C including user defined, built-in, and derived types. User defined types allow users to define new data types like structures and unions. Built-in types include int, char, float, and double. Derived types are arrays and functions.

Uploaded by

Palkar Nilo
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)
33 views5 pages

Unit 1 Part 2

The document discusses different types of data in C including user defined, built-in, and derived types. User defined types allow users to define new data types like structures and unions. Built-in types include int, char, float, and double. Derived types are arrays and functions.

Uploaded by

Palkar Nilo
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/ 5

Data typas in C

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

User Defined type


"type definition allowG aser to detine an identit
that i l l 1epre9ent an eaistinq data i4pe-
a) 9tIucture
A Struc tuIe iS e0lle ction Of ane or mor
Nariables af different data tupe9, qrouped
toqather_under agingle name and new
Cugtom olatatupe formeo
b) union
- uniorn ig a user-detined data tu pe contar
memberg ike Structu but no geDarote meeme
i s allocatecd to each mem ber
*Algorith m Complezity
first, Let us 3e what_ismean
b
algor th m.
lgorith m
- Algori th m is a set of Stepg 1equire o
for solving a problem.
There are number orpropeTEiCS or character-S
ties of the aaorithm

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

E2pCSSI h ime and Space Camplezity


ezpreSse-
-
The time and Spa.ce Co mpleity_can be

uSing function fcn).


a

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

Built-iio dato type


Second type of dota type ig built-in data
type The C containg fouY Standaro data
typg
They aYe I) int
i) float
i)ahar
i ) double
Derived data tyPe:
Thirdtype of data type is deriveddata typ
These are
a) ArLaySi-
ArroyS a1e Set o feleme ntS which
containg homoqeneouS elementS.
b) Function
function is suppoSed to perForm
a well-defined_particular task

You might also like