SlideShare a Scribd company logo
Algorithms 
Introduction By: 
Dr. Ghulam Rasool
Algorithm 
• An algorithm is a well-defined list of steps for solving a 
particular problem 
• The efficiency of an algorithm depends on space and time
Insertion into an array Insert(A,N,K, item) 
• A is array with N elements and K is a +ve integer such that 
K<=N. This algorithm inserts an item into kth location in 
array A 
1 Set J=N 
2 Repeat steps 3 and 4 while J>=K 
3 Set A[J+1]= A[j] 
4 Set J=J-1 
5 Set A[k]= item 
6 Set N=N+1 
7 Exit
Deletion from array Delete(A, N, K, item) 
1 Set item =A[K] 
2 Repeat for j= K to N-1 
Set A[j]= A[J+1] 
3 Set N=N-1 
4 Exit 
Matrix Multiplication(A,B,C, M, N, P) 
1 Repeat steps 2 to 4 for i = 1 to M 
2 Repeat steps 3 to 4 for j= 1 to N 
3 Set C[i][j]= 0 
4 Repeat for k= 1 to P 
Set C[i][j]= C[i][j]+ A[i][k] * B[k][j] 
5 Exit
Assignment1b 
• A magic square is a square matrix of integers 
such that sum of every row, the sum of every 
column and sum of each of the diagonal are 
equal. For example 
• Write an algorithm to read set of integers for 
square matrix and then decide whether the 
matrix represent a magic square or not. 
4 15 14 1 
9 6 7 12 
5 10 11 8 
16 3 2 13

More Related Content

PDF
7th pre alg -l41
PPTX
Scalable k-means plus plus
PPT
Array operations
PPT
Matrix Multiplication(An example of concurrent programming)
PPTX
Linear Sorting
PPTX
1 lesson 6 introduction to radical functions
DOC
Nc assignment
PPTX
Reanalysis Method: Direct Method
7th pre alg -l41
Scalable k-means plus plus
Array operations
Matrix Multiplication(An example of concurrent programming)
Linear Sorting
1 lesson 6 introduction to radical functions
Nc assignment
Reanalysis Method: Direct Method

What's hot (20)

PPTX
K means clustering | K Means ++
PPTX
Learning a nonlinear embedding by preserving class neibourhood structure 최종
PPTX
Computer aided design
PPT
Mba admission in india
PDF
K means clustering
PPTX
Kim Modelling Functions
PDF
Analysis and design of algorithms part 4
DOCX
Matrix multiplicationdesign
PPTX
Daa unit 3
PPTX
K-means Clustering
PDF
Linked list
PPT
PPTX
K-Means Clustering Simply
PPTX
Find Transitive Closure Using Floyd-Warshall Algorithm
PPT
Top schools in gudgao
PPT
PPT
dynamic programming Rod cutting class
PPT
Vector
PPTX
Ms nikita greedy agorithm
PPTX
Dominating set of fixed size in degenerated graph
K means clustering | K Means ++
Learning a nonlinear embedding by preserving class neibourhood structure 최종
Computer aided design
Mba admission in india
K means clustering
Kim Modelling Functions
Analysis and design of algorithms part 4
Matrix multiplicationdesign
Daa unit 3
K-means Clustering
Linked list
K-Means Clustering Simply
Find Transitive Closure Using Floyd-Warshall Algorithm
Top schools in gudgao
dynamic programming Rod cutting class
Vector
Ms nikita greedy agorithm
Dominating set of fixed size in degenerated graph
Ad

Viewers also liked (20)

PPTX
Algorithm - Introduction
PPT
Introduction To Algorithm [2]
PPT
algorithm
PDF
Algorithm and Programming (Introduction of Algorithms)
PPTX
Building Faster Horses: Taking Over An Existing Software Product
DOCX
Core Management - Task 1
PDF
IEA DSM Task 24 Transport Panel at BECC conference
PPT
Lotus Forms Webform Server 3.0 Overview & Architecture
PDF
Technical product manager
PDF
docker
PPTX
kafka-steaming-data
PPTX
Data Representation
PPSX
University Course Timetabling by using Multi Objective Genetic Algortihms
PPTX
Improved Teaching Leaning Based Optimization Algorithm
PPTX
VMworld 2015: vSphere Web Client- Yesterday, Today, and Tomorrow
PPTX
Enterprise Architecture: The role of the Design Authority
PPTX
Introduction To Stack
PPTX
Computer Evolution
PPTX
Introduction To Data Structures.
Algorithm - Introduction
Introduction To Algorithm [2]
algorithm
Algorithm and Programming (Introduction of Algorithms)
Building Faster Horses: Taking Over An Existing Software Product
Core Management - Task 1
IEA DSM Task 24 Transport Panel at BECC conference
Lotus Forms Webform Server 3.0 Overview & Architecture
Technical product manager
docker
kafka-steaming-data
Data Representation
University Course Timetabling by using Multi Objective Genetic Algortihms
Improved Teaching Leaning Based Optimization Algorithm
VMworld 2015: vSphere Web Client- Yesterday, Today, and Tomorrow
Enterprise Architecture: The role of the Design Authority
Introduction To Stack
Computer Evolution
Introduction To Data Structures.
Ad

Similar to Introduction to Algorithm (20)

PPTX
Modile-1-PPT-1-BCAC0207-AlgorithmDesign.pptx
PPTX
Introduction to Algorithms Introduction to Algorithms.pptx
PPT
Problem Solving Techniques notes for Unit 1
PDF
01 CS316_Introduction.pdf5959695559655565
PPTX
Algorithm in data structure bca .pptx
PPTX
Design and Analysis of Algorithm for II year Computer science and Engineering...
PPTX
Data structure using c module 1
PDF
Lecture 2 role of algorithms in computing
PPT
AA Lecture 01 of my lecture os ghhhggh.ppt
PPTX
Algo_lecture1-3.pptx
PPTX
DATA STRUCTURES unit 1.pptx
PPTX
Binary to hexadecimal algorithmic old.pptx
PPSX
Design and Analysis of Algorithms ppt by K. Adi
PPSX
Ds03 part i algorithms by jyoti lakhani
PPTX
problem solving and algorithm development
PPTX
Algorithm analysis and design
PDF
01 Revision Introduction SLides Od Design ANd Aalaysis Of aLgo
PDF
Chapter-1-Introduction-to-Aglorithms.pdf
PPTX
DAA 1 ppt.pptx
Modile-1-PPT-1-BCAC0207-AlgorithmDesign.pptx
Introduction to Algorithms Introduction to Algorithms.pptx
Problem Solving Techniques notes for Unit 1
01 CS316_Introduction.pdf5959695559655565
Algorithm in data structure bca .pptx
Design and Analysis of Algorithm for II year Computer science and Engineering...
Data structure using c module 1
Lecture 2 role of algorithms in computing
AA Lecture 01 of my lecture os ghhhggh.ppt
Algo_lecture1-3.pptx
DATA STRUCTURES unit 1.pptx
Binary to hexadecimal algorithmic old.pptx
Design and Analysis of Algorithms ppt by K. Adi
Ds03 part i algorithms by jyoti lakhani
problem solving and algorithm development
Algorithm analysis and design
01 Revision Introduction SLides Od Design ANd Aalaysis Of aLgo
Chapter-1-Introduction-to-Aglorithms.pdf
DAA 1 ppt.pptx

More from Education Front (20)

PPT
Improving Pronunciation
PPTX
Generic Software Process Models
PPTX
2- Dimensional Arrays
PPTX
Problem Sloving
PPTX
Problem Solving - 1
PPTX
Process Models
PPTX
Process Models
PPT
Revised Process of Communication
PPT
Importance of Language in Communication
PPT
Lecture1 (SE Introduction)
PPTX
Lecture 2 (Software Processes)
PPTX
Introduction to data structure
PPTX
Facing Today’s Communication Challenges
PPTX
Processor Basics
PPTX
Register & Memory
PPTX
Data Representation
PPT
Assembly Language Basics
PPTX
Introduction To EMU
PPTX
Lecture 2: Facing Today’s Communication Challenges.
PPTX
Effective communication skills
Improving Pronunciation
Generic Software Process Models
2- Dimensional Arrays
Problem Sloving
Problem Solving - 1
Process Models
Process Models
Revised Process of Communication
Importance of Language in Communication
Lecture1 (SE Introduction)
Lecture 2 (Software Processes)
Introduction to data structure
Facing Today’s Communication Challenges
Processor Basics
Register & Memory
Data Representation
Assembly Language Basics
Introduction To EMU
Lecture 2: Facing Today’s Communication Challenges.
Effective communication skills

Recently uploaded (20)

PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
Sustainable Sites - Green Building Construction
PDF
737-MAX_SRG.pdf student reference guides
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Internet of Things (IOT) - A guide to understanding
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPT
Total quality management ppt for engineering students
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Sustainable Sites - Green Building Construction
737-MAX_SRG.pdf student reference guides
R24 SURVEYING LAB MANUAL for civil enggi
Internet of Things (IOT) - A guide to understanding
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
III.4.1.2_The_Space_Environment.p pdffdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
UNIT 4 Total Quality Management .pptx
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Embodied AI: Ushering in the Next Era of Intelligent Systems
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Total quality management ppt for engineering students

Introduction to Algorithm

  • 1. Algorithms Introduction By: Dr. Ghulam Rasool
  • 2. Algorithm • An algorithm is a well-defined list of steps for solving a particular problem • The efficiency of an algorithm depends on space and time
  • 3. Insertion into an array Insert(A,N,K, item) • A is array with N elements and K is a +ve integer such that K<=N. This algorithm inserts an item into kth location in array A 1 Set J=N 2 Repeat steps 3 and 4 while J>=K 3 Set A[J+1]= A[j] 4 Set J=J-1 5 Set A[k]= item 6 Set N=N+1 7 Exit
  • 4. Deletion from array Delete(A, N, K, item) 1 Set item =A[K] 2 Repeat for j= K to N-1 Set A[j]= A[J+1] 3 Set N=N-1 4 Exit Matrix Multiplication(A,B,C, M, N, P) 1 Repeat steps 2 to 4 for i = 1 to M 2 Repeat steps 3 to 4 for j= 1 to N 3 Set C[i][j]= 0 4 Repeat for k= 1 to P Set C[i][j]= C[i][j]+ A[i][k] * B[k][j] 5 Exit
  • 5. Assignment1b • A magic square is a square matrix of integers such that sum of every row, the sum of every column and sum of each of the diagonal are equal. For example • Write an algorithm to read set of integers for square matrix and then decide whether the matrix represent a magic square or not. 4 15 14 1 9 6 7 12 5 10 11 8 16 3 2 13