lec1
lec1
INDEX
■ Introduction
■ Data
■ Data types
■ Data structure
■ Abstract data types (ADT)
■ Algorithm
■ Characteristics of an algorithm
Introduction
■ Learning data structures and algorithms allow us to write
efficient and optimized computer programs.
■ Data – The quantities, characters, or symbols on which
operations are performed by a computer, which may be stored
and transmitted in the form of electrical signals and recorded
on magnetic, optical, or mechanical recording media.
■ Structures - Something arranged in a definite pattern of
organization.
■ Algorithm - An algorithm is a process or a set of rules
required to perform calculations or some other problem-solving
operations especially by a computer.
Data
■ Computer data is information processed or stored by a
computer.
■ This information may be in the form of text documents,
images, audio clips, software programs, or other types
of data.
■ Computer data may be processed by the
computer's CPU and is stored in files and folders on the
computer's hard disk.
■ A bit is the smallest unit of data, and represents just a
single value.
■ A byte is eight binary digits long.
■ Storage and memory is measured
in megabytes and gigabytes.
Algorithm
■ Algorithm is a step-by-step procedure, which defines a set of
instructions to be executed in a certain order to get the desired
output.
■ Algorithms are generally created independent of underlying
languages, i.e. an algorithm can be implemented in more than
one programming language.
Example
• Let's try to learn algorithm-writing by using an example.
Problem − Design an algorithm to add two numbers and
display the result.
• Algorithms tell the programmers how to code the
program. Alternatively, the algorithm can be written as −
• Step 1 − START ADD
• Step 2 − get values of a & b
• Step 3 − c ← a + b
• Step 4 − display c
• Step 5 − STOP