Sunteți pe pagina 1din 36

A

computer is an electronic device that


Takes some input () from the outside world
through some input device
Processes() this input to produce output
Provides this output () to outside world
through some output device.

Q. 1 What is this Input ?


Q.2 What is this Process ?
Q.3 What is this Output ?

DATA PROCESSOR
INPUT
(DATA)

Process
(Transformation)

OUTPUT
(INFORMATION)

Q. 1 What is this Input ? (Data)


Q.2 What is this Process ? (Transformation)
Q.3 What is this Output ? (Information)

Data:

Data is raw material


which is unprocessed for data processing.
It is normally entered by input devices
into computer and it can be in any form,
usable or not.

Information:
Measured
1KB
1MB
1GB

Bytes
1024
104876
1073741824

Bytes
210
220
230

Information is data that has been processed.


It can be useful for the person receiving
since it brings meaning.
It can be understood by user.
Information is processed data
obtained as output of data processing.

Program:

Program is a set of instruction


that tells the computer what to do.

DATA

Storage
Access
Manipulate
Types
Operation
Applicaton

PROGRAM

How to Write
Proof of correctness
Efficiency

Input Unit:
All data and instructions need to be
entered into the computer system
through the input unit.
Accepts the data and instructions
from the outside world.
Converts the data and instruction
into a form that computer can
understand.
The converted data and instructions
are sent to the computer system for
further processing.

Memory Unit:
Internal data storage in a computer.
The memory is comprised of a large
number of individual cells, each with a
unique number, known as its address,
associated with it.

Storage Unit:
The basic unit of storage in computer
is bit. Bit is binary digit which can be
set to either 0 or 1.
The storage capacity of a computer is
measured in terms of bytes;
1 byte is equal to 8 bits.

Primary Storage
It stores and provide very fast.
This memory is generally used to
o hold the program being currently
executed in the computer.
o the data being received from the
input unit, manipulated the data
and final results of the program.
The primary memory is temporary in
nature.

The data is lost, when the computer is


turned off.
In order to store the data permanently,
the data has to be transferred to the
secondary memory.
It is the only one directly accessible to
the CPU. The CPU continuously reads
instructions stored there and executes
them as required.

Secondary Storage
Secondary storage is used like an archive.
It stores several programs, documents,
database etc.
Whenever the results are saved, again they
get stored in the secondary memory.
Secondary storage differs from primary
storage in that it is not directly accessible by
the CPU.
The secondary memory is slower than the
primary memory.
Some of the commonly used secondary
memory devices are hard disk, CD etc.

Output Unit:
Accepts results from the processing unit of
computer.
Converts those results into human readable form.
Provides the results to outside world.

Central Processing Unit (CPU):


The part of the computer that executes the
instructions (program) stored in memory.
The CPU is consists of the Control Unit (CU) and the
Arithmetic/Logical Unit (ALU).
It is a brain of computer system.

Control Unit
The CU coordinates and controls all activities
of the computer.
It is the CU that tells the input unit to accept
data from the outside world and pass it on to
the storage for further processing.
The component of the CPU that control other
components, So that the instructions are
executed in the correct sequence.

Arithmetic/Logical Unit (ALU)


The component of the CPU that performs
arithmetic and logical operations it is
called ALU.
Arithmetic Operations:
These are the type of operations in which
calculation(s) is /are involved.
Logical Operations: These are the type
of operations in which decision(s) is/are
involved.

Data

Structures
[Schaums Outline]

An

By

Seymour

Lipschutz

Introduction to Data structures with


Applications by Tremblay and Sorenson

Data
Structure
Algorithm

Data

are values or a set of values


Data item refers to single unit of values
Data item

Group item :
Data item that can be subdivided into sub item.
Ex Name : First Name, Middle initial and Last Name

Elementary item:
Data item that can not be sub divided into sub item
Ex : PAN card number / Bank Pass Book Number is
treated as single item

Collection of data are frequently organized


into a hierarchy of fields, records and files

Entity

Something that has certain attributes or properties


which may be assigned values
Values may be numeric or non-numeric

Ex:

The employee of an organization

Attributes Name
Values
John

Age Sex Employee Code


33
M
13472

Entity

with similar attributes ( e.g all employees


of an organization) form an entity set

Each

attribute of an entity set has a range of


values [ the set of possible values that could be
assigned to the particular attribute]

Information:

processed data

Data with given attribute or

The

way that data are organized in to the


hierarchy of fields, records and file reflects
the relationship between attributes, entity
and entity set
Field is a single elementary unit of information
representing an attribute of an entity
Record is the collection of field values of a given
entity
File is the collection of records of the entities in a
given entity set

Name Age

Sex Roll Number

Branch

A
B
C

17
18
19

M
M
F

109cs0132
109ee1234
109ce0012

CSE
EE
CE

20

108mm0132

MM

Record

Fixed Length
Variable Length

The

above organizations of data into fields, records


and file may not be complex enough to maintain
and efficiently process certain collection of data.
For this reason, data are also organized into more
complex types of structures.
Study of Data Structure includes the following
three steps

Logical or Mathematical description of the structure


Implementation of the structure on a computer
Quantitative analysis of the structure, which includes
determining the amount of memory needed to store the
structure and the time required to process the structure

A data

type is a term which refers to the kind of


data that may appear in computation.
Ex: in C
int,

float, char, double, long double, etc.

Data

Structure

The

logical or mathematical model of a particular


organization of data

Choice
It

of a model depends on two factor

must be rich enough in structure to mirror the actual


relationships of the data in the real world
The structure should be simple enough that one can
effectively process the data when necessary

Customer

Salesperson

Adams

Smith

Brown

Ray

Clark

Jones

Drew

Ray

Evans

Smith

Farmer

Jones

Geller

Ray

Hill

Smith

Customer

Pointer

Salesperson

Adams

Jones

Brown

Ray

Clark

Smith

Drew

Evans

Farmer

Geller

Hill

Customer

Pointer

Salesperson

Pointer

Adams

Jones

3,6

Brown

Ray

2,4,7

Clark

Smith

1,5,8

Drew

Evans

Farmer

Geller

Hill

Customer

Pointer

Salesperson

Pointer

Adams

Jones

Brown

Ray

Clark

Smith

Drew

Evans

Farmer

Geller

Hill

data structure is a way to logically organize


data that specifies:

A set of data elements i.e., a data object and


A set of operations which may legally be applied
to elements of this data object.

Data

appearing in DS are processed by means of


certain operation

Particular

DS one chooses for a given situation


depends largely on the frequency with which
specific operations are performed

Traversing:

Accessing each record exactly once so


that certain items in the record may be processed
[ Also known as Visiting the record]

Searching:

Finding the location of the record with


a given key value, or finding the locations of all
record which satisfy one or more conditions

Inserting

: Adding a new record to the structure

Deleting

: Removing a record from the structure

In real life applications, various kind of data


other than the primitive data are involved.
Manipulation of real-life data (user data)
requires the following essential tasks:
a) Storage representation of user data: User data

should be stored in such a way that computer can


understand
b) Retrieval of stored data: Data stored in a
computer should be retrieved in such a way that user
can understand.
c) Transformation of user data: Various operations
which require to be performed on user data so that it
can be transformed from one form to another.