Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views

Data Algorithms and Program

Dap

Uploaded by

sudarshanpp22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Data Algorithms and Program

Dap

Uploaded by

sudarshanpp22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Introduction to

Data, Algorithms
& Program
Prof. A.P.Khan
Department of Computer Engineering
D.N.Patel College of Engineering, Shahada
Content
Data

Data Types

Basic Operations of Data

Abstract Data Type

Algorithms

Program 2
Introduction to Data

Data: are simply a value are set of values.


Data are simply collection of facts and figures.
Data items that are divided into sub-items are
called Group items. Ex: An Employee Name
may be divided into three sub items- first
name, middle name, and last name.
2
Data items that are
not able to divide
into sub-items are
called Elementary
items. Ex: SSN
In the above example (ID, Age, Gender, First,
Middle, Last, Street, Area) are elementary data
item where ( Name, Address) are Group data
item 4
Entity: An entity is something that has certain
attributes or properties which may be assigned.
values. The values may be either numeric or
non-numeric.
Ex: Attributes- Names, Age, Sex, SSN
Values- Rohland Gail, 34, F, 134-34-5533
Entities with similar attributes form an entity set.
5
Each attribute of an entity set has a range of values, the
set of all possible values that could be assigned to the
particular attribute. The term “information” is sometimes
used for data with given attributes, of, in other words
meaningful or processed data.
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. 6
Data Types

Data type is a way to classify various types of data


such as integer, string, etc. which determines the
values that can be used with the corresponding type
of data, the type of operations that can be performed
on the corresponding type of data. There are two
data types −
Built-in Data Type

Derived Data Type 7


Built-in Data Type

Those data types for which a language has built-


in support are known as Built-in Data types. For
example, most of the languages provide the
following built-in data types.
Integers
Boolean (true, false)
Floating (Decimal numbers)
Character and Strings 8
Derived Data Type

Those data types which are implementation independent


as they can be implemented in one or the other way are
known as derived data types. These data types are
normally built by the combination of primary or built-in
data types and associated operations on them. For
example −
Union
Structure
9
Basic Operations

The data in the data structures are processed by


certain operations. The particular data structure
chosen largely depends on the frequency of the
operation that needs to be performed on the data
structure.
Traversing Deletion
Searching Sorting
Insertion Merging
10
Traversing Searching
It means to access each data It is used to find the location
item exactly once so that it of one or more data items that
can be processed. For satisfy the give constraint.
example, to print the names example, to find the names of
of all the students in a class. all the students who secured
100 marks in mathematics.

11
Inserting Deleting
It is used to add new data It means to remove (delete) a
items to the given list of data particular data item from the
items. For example, to add given collection of data items.
the details of a new student For example, to delete the
who has recently joined the name of a student who has
course. left the course.

12
Sorting
Data items can be arranged in some order like
ascending order or descending order example,
arranging the names of students in a class in an
alphabetical order, or calculating the top three winners
by arranging the participants’ scores in descending
order and then extracting the top three.
Merging
Lists of two sorted data items can be combined to
form a single list of sorted data items. 13
Abstract Data Type

An abstract data type (ADT) is defined as a.


declaration packaged together with the operations
that are meaningful for the data type. In other
words, we encapsulate the data and the operations
and we hide them from a user.
The concepts of Abstract Data Type Means:
1. We know what the data type can do.
2. How it is done is hidden 14
Introduction of Algorithms

To make a computer do anything, you need to write


a computer program. Computer is nothing but, to tell
the computer step by step exactly what you want it to
do.
An algorithm is defined as a step-by-step
procedure or method for solving a problem by a
computer in a finite number of steps.

15
An Algorithm is sequence of unambiguous steps for
solving a problem i.e., for obtaining a required
solution outcome for any valid input in a finite
amount of time

16
A well defined algorithm has five Good
Characteristics
Finiteness. An algorithm must always terminate after
a finite number of steps.
Definiteness. Each step of an algorithm must be
precisely defined; the actions to be carried and
unambiguously specified for each case.
Input. An algorithm has zero or more inputs,
which are given to it initially before the algorithm
begins.
17
Output. An algorithm has one or more outputs i.e,
quantities which have a specified relation to the
inputs.
Effectiveness. An algorithm is also generally
expected to be effective. This means that all of the
operations to be performed in the algorithm must be
sufficiently basic that they can in principle be done
exactly and in a finite length of time.

18
19
Program

As a verb, program or programming is a term


used to describe the process of a programmer
developing a software program by programming.
A program is like a recipe. It contains a list of
ingredients (called variables) and a list of
directions (called statements) that tell the
computer what to do with the variables.
The variables can represent numeric data, text, or
graphical images. 20
Writing a good Program requires lot of skill and
logical thinking. What one requires is, good
understanding of the language in which he or she
going to write a program.
C is programming language is the most widely
used language for writing application program.
It is more popular language of engineering.
We can learn data structure through their
implementation in c.
21
This unit gives introduction of basis concepts of
c language such as input output, if-else , for,
while, statement, etc.
You also learn how to write a simple c program.

22
Steps of Development of Program

Define and understand the program.


Plan the method for solution.
Develop the most suitable method using tools like
flowchart/ algorithm.
Coding( writing Program in a high level language).
Editing, compiling, debugging, execution, and
testing the program.
Documentation. 23
24
THANKS!
Any questions?
+91-9893092930
er.ashfaqkhan@gmail.com

25

You might also like