Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
16 views24 pages

1.1 - Introd. To Algo

The document outlines the introduction to algorithms as part of a computer science engineering course, detailing the characteristics, specifications, and applications of algorithms. It emphasizes the importance of algorithms in problem-solving and efficiency improvement, along with the distinction between algorithms and programs. The document also includes a brief overview of linear search, its pseudocode, and references for further learning.

Uploaded by

Love Status King
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views24 pages

1.1 - Introd. To Algo

The document outlines the introduction to algorithms as part of a computer science engineering course, detailing the characteristics, specifications, and applications of algorithms. It emphasizes the importance of algorithms in problem-solving and efficiency improvement, along with the distinction between algorithms and programs. The document also includes a brief overview of linear search, its pseudocode, and references for further learning.

Uploaded by

Love Status King
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Academic Session 2025-26

ODD Semester Jul-Dec 2025

UNIVERSITY INSTITUTE OF ENGINEERING


COMPUTER SCIENCE ENGINEERING
Bachelor of Engineering
Semester: 6th
Design and Analysis of Algorithms
(23CSH-301/ITH-301)
Unit No. 1 Chapter No. 1 Lecture No.1
Topic : Introduction to Algorithm
Richa Dhiman E11307 Assistant Professor
Learning Objectives & Outcomes
1

Objective:
• To understand meaning and characteristics of algorithms

Outcome:
• Student will understand the meaning of algorithm and its
characteristics.
Design and Analysis of Algorithm
2

• Design and Analysis of Algorithm is very important for


designing algorithm to solve different types of
problems in the branch of computer science and
information technology.
3

Basic Concept
4

What is Algorithm?
A finite set of instruction that specifies a sequence of
operation is to be carried out in order to solve a specific
problem or class of problems is called an Algorithm.

Set of
rules to
obtain the
expected
Input Output
output
from the
given
input
5

Characteristics of an Algorithm
• Input − An algorithm should have 0 or more well-defined inputs.
• Output − An algorithm should have 1 or more well-defined outputs,
and should match the desired output.
• Unambiguous/ Definiteness − Algorithm should be clear and
unambiguous.
• Finiteness − Algorithms must terminate after a finite number of
steps.
• Feasibility − Should be feasible with the available resources.
• Independent − An algorithm should have step-by-step directions,
which should be independent of any programming code.
Common terms used in Algorithm 6

• Variable: specific location in computer memory used to


store one and only one value.

• Datatypes: the type of data a variable can hold

• Statement : line of code


Applications 7

•Search Engines: PageRank algorithm, crawling, indexing (e.g.,


Google Search)
•Route Optimization: Dijkstra’s algorithm, A*, Bellman-Ford in
Google Maps, logistics
•Scheduling: Job-shop scheduling in manufacturing, CPU
scheduling in OS.
•Sorting Algorithms: Quick Sort, Merge Sort, Heap Sort in
database operations
•String Matching: KMP, Rabin-Karp in plagiarism detection,
bioinformatics (DNA sequence analysis)
•Pattern Recognition: Used in OCR (Optical Character
Recognition), handwriting analysis
8

Algorithm Specification
Algorithm can be described in three ways:

1) Natural language like English

2) Graphic representation called flowchart

3) Pseudo-code Method
9

Algorithm of linear search :

1. Start from the leftmost element of arr[] and one by


one compare x with each element of arr[].
2. If x matches with an element, return the index.
3. If x doesn’t match with any of elements, return -1.
10

Pseudocode for Linear Search :

FUNCTION linearSearch(list, searchTerm):


FOR index FROM 0 -> length(list):
IF list[index] == searchTerm
THEN RETURN index
ENDIF
ENDLOOP
RETURN -1
END FUNCTION
11
Program for Linear Search :
int search(int arr[], int n, int x)
{
int i;
for (i = 0; i < n; i++)
if (arr[i] == x)
return i;
return -1;
}
Need of Algorithm
12

1. To understand the basic idea of the problem.


2. To find an approach to solve the problem.
3. To improve the efficiency of existing techniques.
4. To understand the basic principles of designing the
algorithms.
5. To compare the performance of the algorithm with respect
to other techniques.
6. It is the best method of description without describing the
implementation detail.
7. The Algorithm gives a clear description of requirements and
goal of the problem to the designer.
Need of Algorithm (CONTD…)
13

8. A good design can produce a good solution.


9. To understand the flow of the problem.
10. To measure the behavior (or performance) of the methods
in all cases (best cases, worst cases, average cases)
11. With the help of an algorithm, we can also identify the
resources (memory, input-output) cycles required by the
algorithm.
12. With the help of algorithm, we convert art into a science.
13. To understand the principle of designing.
14. We can measure and analyze the complexity (time and
space) of the problems concerning input size without
implementing and running it; it will reduce the cost of
design.
Algorithm vs Program
14

• A finite set of instructions that specifies a sequence of


operations to be carried out to solve a specific problem of a
class of problem is called an algorithm.

• Program doesn't have to satisfy the finiteness condition. For


example, we can think of an operating system that
continues in a "wait" loop until more jobs are entered. Such
a program doesn't terminate unless the system crashes.
15
Issues or study of Algorithm 16

• How to device or design an algorithm --> creating and


algorithm.
• How to express an algorithm --> definiteness.
• How to analysis an algorithm --> time and space
complexity.
• How to validate an algorithm --> fitness.
• Testing the algorithm --> checking for error.
Summary 17

Introduction to Algorithm
• Characteristic of algorithm
• Needs and specification of algorithm
18

Next Lecture
• Time and Space complexity
• Average and worst-case Analysis
• Asymptotic notations
19

Quiz
1. Which of the following best defines an algorithm?
A. computer programming language
B. A step-by-step procedure to solve a problem
C. A type of computer
D. A software application

2. Every algorithm must have a definite starting and


ending point?
References/ Articles/ Videos 20

Text books:
•Cormen, Leiserson, Rivest, Stein, “Introduction to Algorithms”, Prentice Hall of
India, 3rd edition 2012. problem, Graph coloring.
•Horowitz, Sahni and Rajasekaran, “Fundamentals of ComputerAlgorithms”,
University Press (India), 2nd edition

Websites:
1.https://www.geeksforgeeks.org/introduction-to-algorithms/
2.https://www.tutorialspoint.com/design_and_analysis_of_algorithms/index.ht
m
Faculty-curated videos, NPTEL, 21

Coursera, LinkedIn, or other relevant


learning resources
1. https://onlinecourses.nptel.ac.in/noc23_cs96/preview
2. https://nptel.ac.in/courses/106106131
3. https://nptel.ac.in/courses/106106208
4. https://www.linkedin.com/learning/learning-algorithms
23

Class-Wise Feedback
24

Thank You
For queries
Email: [email protected]

You might also like