SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Lecture 1
1
Design and Analysis of Algorithms
Adnan Rashid
Adnan Rashid
CS-251: Design and
Analysis of Algorithms
(Spring 2023)
Email: adnan.rashid@seecs.edu.pk
Web: http://save.seecs.nust.edu.pk/adnanrashid/
Outline
▪ Course Objectives
▪ Introduction
▪ Assessment Plan
▪ What is an algorithm?
▪ About us
▪ General Instructions
2
Design and Analysis of Algorithms
Adnan Rashid
▪ Algorithm vs Program
▪ Properties of Algorithms
Lecture’s Content
Introduction to Algorithms (4th Edition) by
Thomas H. Cormen et al.
Section 1.1 (Page 28 onwards)
3
Design and Analysis of Algorithms
Adnan Rashid
Objectives of Course
Objective 1: Understand the operation, implementation
and performance of fundamental algorithms and data
structures, and the relative merits and suitability of each
for various applications
4
Design and Analysis of Algorithms
Adnan Rashid
Objective 2: Ability to model and implement efficient
software solutions for various application areas using
appropriately selected algorithms and data structures
Objective 3: Ability to analyze data structures and
algorithms, to compare and evaluate them with respect to
time and space requirements, in order to make the most
appropriate design choices when solving real-world problems
Algorithm Definition
▪ An algorithm is a step-by-step procedure for solving a
particular problem in a finite amount of time
▪ More generally, an algorithm is any well-defined
computational procedure that takes collection of elements
as input and produces a collection of elements as output
5
Design and Analysis of Algorithms
Adnan Rashid
Input
X
Some mysterious
processing
Output
Y = F(X)
ALGORITHM
F: X→Y
Algorithm: Examples
6
Design and Analysis of Algorithms
Adnan Rashid
▪ Repairing a lamp
▪ Matrix multiplication
▪ Calling a friend on the phone
▪ The rules of how to play a game
▪ Directions for driving from A to B
▪ A car repair manual
▪ Human brain project
▪ Internet and communication links (Graphs)
▪ A cooking recipe
Algorithm vs Program
▪ A computer program is an instance, or concrete representation,
for an algorithm in some programming language
▪ Set of instructions, which the computer follows to solve a problem
Problem
High Level
Language
Program
Algorithm: A sequence of
instructions describing
how to do a task
7
Design and Analysis of Algorithms
Adnan Rashid
Solving Problems
8
Design and Analysis of Algorithms
Adnan Rashid
When faced with a problem:
1. First clearly define the problem
2. Think of possible solutions
3. Select the one that seems the best under the prevailing
circumstances
4. And then apply that solution
5. If the solution works as desired, fine; else go back to
Step 2
Solving Problems:
General Solution-Algorithm
9
Design and Analysis of Algorithms
Adnan Rashid
▪ It is quite common to first solve a problem for a
particular case
▪ Then for another
▪ And, possibly another
▪ And watch for patterns and trends that emerge
▪ And to use the knowledge from these patterns and
trends in coming up with a general solution
▪ And this general solution is called an algorithm
One Problem, Many
Algorithms
10
Design and Analysis of Algorithms
Adnan Rashid
Problem
▪ The statement of the problem specifies, in general
terms, the desired input/output relationship
Algorithm
▪ The algorithm describes a specific computational
procedure for achieving input/output relationship
▪ Sorting a sequence of numbers into non-decreasing order
Example
▪ Various algorithms e.g., merge sort, quick sort, heap
sorts etc.
Algorithms
Problem Instances
11
Design and Analysis of Algorithms
Adnan Rashid
▪ An input sequence is called an instance of a Problem
▪ A problem has many particular instances
▪ An algorithm must work correctly on all instances of
the problem it claims to solve
▪ Many interesting problems have infinitely many
instances
▪ Since computers are finite, we usually need to limit the
number and/or size of possible instances in this case
▪ This restriction doesn’t prevent us from doing analysis
in the abstract
Properties of Algorithms
12
Design and Analysis of Algorithms
Adnan Rashid
▪ It must be composed of an ordered sequence of precise
steps
▪ It must have a finite number of well-defined instructions
/steps
▪ The execution sequence of instructions should not be
ambiguous
▪ It must be correct
▪ It must terminate
Syntax and Semantics
13
Design and Analysis of Algorithms
Adnan Rashid
An algorithm is “correct” if
its:
▪ Semantics are correct
▪ Syntax is correct
Semantics:
▪ The concept embedded in
an algorithm (the soul!)
Syntax:
▪ The actual representation
of an algorithm (the body!)
WARNINGS:
1. An algorithm can be
syntactically correct,
yet semantically
incorrect – dangerous
situation!
2. Syntactic
correctness is easier
to check as compared
to semantic
correctness
Algorithm Summary
14
Design and Analysis of Algorithms
Adnan Rashid
▪ Problem Statement
▪ Relationship between the input and output
▪ Algorithm
▪ Procedure to achieve the relationship
▪ Definition
▪ A sequence of steps that transform the input to output
▪ Instance
▪ The input needed to compute solution
▪ Correct Algorithm
▪ For every input it halts with correct output
About Us
▪ Instructor
▪ Dr. Adnan Rashid (A-226, Faculty Block, SEECS)
▪ Contact: adnan.rashid@seecs.edu.pk
▪ Telephone: +92 51 9085 2176
▪ Web: http://save.seecs.nust.edu.pk/adnanrashid/
https://seecs.nust.edu.pk/faculty/adnan-rashid/
15
Design and Analysis of Algorithms
Adnan Rashid
Course Updates
▪ Updates (on LMS, Email):
▪ Updates and Discussions (on WhatsApp):
https://tinyurl.com/yckj3x52
16
Design and Analysis of Algorithms
Adnan Rashid
Course Updates
17
Compiler Construction
Adnan Rashid
▪ Office Hours: By appointment only (via email)
▪ Code for Course Self Enrollment on LMS:
183750294
Class Schedule, LMS and
CMS
18
Compiler Construction
Adnan Rashid
▪ Consult LMS for
▪ Lecture Notes, Quizzes, Assignments and Labs
▪ Online Feedback
Day BESE-12B
Thursday 0900-1000 (Lecture Hall–IAEC)
Thursday 1000-1100 (Lecture Hall–IAEC)
Friday 1000-1100 (CR-20–SMRIMMS)
▪ Consult Qalam for
▪ Attendance and grades
Attendance Policy
19
Compiler Construction
Adnan Rashid
▪ 75-100% required at the end of semester!
▪ No compensation for attendance!
▪ Attendance will be taken at any moment
Textbook
20
Compiler Construction
Adnan Rashid
▪ Thomas H. Cormen,
Introduction to Algorithms
(4th edition) 2022, MIT
Press
Assessment Plan
(Tentative)
21
Compiler Construction
Adnan Rashid
▪ 40% Final Exam (Closed Books, Closed Notes, Comprehensive)
▪ 30% Mid Term (Closed Books, Closed Notes, Comprehensive)
▪ 10% Quizzes (Minimum 05, Surprise!)
▪ 10% Project
▪ 10% Assignments (Minimum 03)
Homework/Assignment
Policy
22
Compiler Construction
Adnan Rashid
▪ All homework assignments must be done individually
or as directed
▪ May also require uploading a soft-copy on LMS (for
plagiarism check)
▪ Cheating
▪ Helping others, getting help, looking up websites for
solutions etc.
▪ Late Submissions
▪ Late submission will get a –20% penalty up to one day
▪ -40% penalty up to 2 days (No acceptation after 2
days from deadline)
Homework/Assignment
Policy
23
Compiler Construction
Adnan Rashid
▪ Any deviation from the above rule will be considered
cheating and will be subject to the SEECS academic
dishonesty policy
▪ Contact instructor at least 03 days before the
deadline in case of emergency
http://seecs.nust.edu.pk/Internal/downloads/downloads/SE
ECS_Plagiarism_Policy_Dec2010_v1.0.pdf
Lecture Basics
24
Compiler Construction
Adnan Rashid
▪ Classes will mainly involve Slides
▪ Lectures (pdf) will be available on LMS
▪ However, no scribes from the class will be made
available
▪ Therefore, take your own notes in the class
▪ For latest/updated slides, download before each use
▪ As I might update/correct slides at any stage
Thank you!
25
Design and Analysis of Algorithms
Adnan Rashid

Más contenido relacionado

Similar a Lecture_01_Spring_2023.pdf

Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdf
HarshNagda5
 
Algorithm & data structures lec1
Algorithm & data structures lec1Algorithm & data structures lec1
Algorithm & data structures lec1
Abdul Khan
 

Similar a Lecture_01_Spring_2023.pdf (20)

Algo_Lecture01.pptx
Algo_Lecture01.pptxAlgo_Lecture01.pptx
Algo_Lecture01.pptx
 
How to build a successfull software
How to build a successfull softwareHow to build a successfull software
How to build a successfull software
 
Better java with design
Better java with designBetter java with design
Better java with design
 
Simulation Data Management-Aras
Simulation Data Management-ArasSimulation Data Management-Aras
Simulation Data Management-Aras
 
Amazon interview questions
Amazon interview questionsAmazon interview questions
Amazon interview questions
 
L21 Architecture and Agile
L21 Architecture and AgileL21 Architecture and Agile
L21 Architecture and Agile
 
Refactoring, Therapeutic Attitude to Programming.
Refactoring, Therapeutic Attitude to Programming.Refactoring, Therapeutic Attitude to Programming.
Refactoring, Therapeutic Attitude to Programming.
 
Think like a programmer
Think like a programmerThink like a programmer
Think like a programmer
 
Toward a Traceable, Explainable and fair JD/Resume Recommendation System
Toward a Traceable, Explainable and fair JD/Resume Recommendation SystemToward a Traceable, Explainable and fair JD/Resume Recommendation System
Toward a Traceable, Explainable and fair JD/Resume Recommendation System
 
Computer science curriculum based on Program learning outcomes and objectives
Computer science curriculum based on Program learning outcomes and objectivesComputer science curriculum based on Program learning outcomes and objectives
Computer science curriculum based on Program learning outcomes and objectives
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdf
 
Problem solving
Problem solvingProblem solving
Problem solving
 
Thinking in data structures
Thinking in data structuresThinking in data structures
Thinking in data structures
 
intro.pptx
intro.pptxintro.pptx
intro.pptx
 
Algorithm & data structures lec1
Algorithm & data structures lec1Algorithm & data structures lec1
Algorithm & data structures lec1
 
Hello to code
Hello to codeHello to code
Hello to code
 
Session 3 : Competitive programming 1
Session 3 : Competitive programming 1Session 3 : Competitive programming 1
Session 3 : Competitive programming 1
 
CH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptxCH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptx
 
Lecture01.ppt
Lecture01.pptLecture01.ppt
Lecture01.ppt
 
Algorithm Design
Algorithm DesignAlgorithm Design
Algorithm Design
 

Último

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Último (20)

Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 

Lecture_01_Spring_2023.pdf

  • 1. Lecture 1 1 Design and Analysis of Algorithms Adnan Rashid Adnan Rashid CS-251: Design and Analysis of Algorithms (Spring 2023) Email: adnan.rashid@seecs.edu.pk Web: http://save.seecs.nust.edu.pk/adnanrashid/
  • 2. Outline ▪ Course Objectives ▪ Introduction ▪ Assessment Plan ▪ What is an algorithm? ▪ About us ▪ General Instructions 2 Design and Analysis of Algorithms Adnan Rashid ▪ Algorithm vs Program ▪ Properties of Algorithms
  • 3. Lecture’s Content Introduction to Algorithms (4th Edition) by Thomas H. Cormen et al. Section 1.1 (Page 28 onwards) 3 Design and Analysis of Algorithms Adnan Rashid
  • 4. Objectives of Course Objective 1: Understand the operation, implementation and performance of fundamental algorithms and data structures, and the relative merits and suitability of each for various applications 4 Design and Analysis of Algorithms Adnan Rashid Objective 2: Ability to model and implement efficient software solutions for various application areas using appropriately selected algorithms and data structures Objective 3: Ability to analyze data structures and algorithms, to compare and evaluate them with respect to time and space requirements, in order to make the most appropriate design choices when solving real-world problems
  • 5. Algorithm Definition ▪ An algorithm is a step-by-step procedure for solving a particular problem in a finite amount of time ▪ More generally, an algorithm is any well-defined computational procedure that takes collection of elements as input and produces a collection of elements as output 5 Design and Analysis of Algorithms Adnan Rashid Input X Some mysterious processing Output Y = F(X) ALGORITHM F: X→Y
  • 6. Algorithm: Examples 6 Design and Analysis of Algorithms Adnan Rashid ▪ Repairing a lamp ▪ Matrix multiplication ▪ Calling a friend on the phone ▪ The rules of how to play a game ▪ Directions for driving from A to B ▪ A car repair manual ▪ Human brain project ▪ Internet and communication links (Graphs) ▪ A cooking recipe
  • 7. Algorithm vs Program ▪ A computer program is an instance, or concrete representation, for an algorithm in some programming language ▪ Set of instructions, which the computer follows to solve a problem Problem High Level Language Program Algorithm: A sequence of instructions describing how to do a task 7 Design and Analysis of Algorithms Adnan Rashid
  • 8. Solving Problems 8 Design and Analysis of Algorithms Adnan Rashid When faced with a problem: 1. First clearly define the problem 2. Think of possible solutions 3. Select the one that seems the best under the prevailing circumstances 4. And then apply that solution 5. If the solution works as desired, fine; else go back to Step 2
  • 9. Solving Problems: General Solution-Algorithm 9 Design and Analysis of Algorithms Adnan Rashid ▪ It is quite common to first solve a problem for a particular case ▪ Then for another ▪ And, possibly another ▪ And watch for patterns and trends that emerge ▪ And to use the knowledge from these patterns and trends in coming up with a general solution ▪ And this general solution is called an algorithm
  • 10. One Problem, Many Algorithms 10 Design and Analysis of Algorithms Adnan Rashid Problem ▪ The statement of the problem specifies, in general terms, the desired input/output relationship Algorithm ▪ The algorithm describes a specific computational procedure for achieving input/output relationship ▪ Sorting a sequence of numbers into non-decreasing order Example ▪ Various algorithms e.g., merge sort, quick sort, heap sorts etc. Algorithms
  • 11. Problem Instances 11 Design and Analysis of Algorithms Adnan Rashid ▪ An input sequence is called an instance of a Problem ▪ A problem has many particular instances ▪ An algorithm must work correctly on all instances of the problem it claims to solve ▪ Many interesting problems have infinitely many instances ▪ Since computers are finite, we usually need to limit the number and/or size of possible instances in this case ▪ This restriction doesn’t prevent us from doing analysis in the abstract
  • 12. Properties of Algorithms 12 Design and Analysis of Algorithms Adnan Rashid ▪ It must be composed of an ordered sequence of precise steps ▪ It must have a finite number of well-defined instructions /steps ▪ The execution sequence of instructions should not be ambiguous ▪ It must be correct ▪ It must terminate
  • 13. Syntax and Semantics 13 Design and Analysis of Algorithms Adnan Rashid An algorithm is “correct” if its: ▪ Semantics are correct ▪ Syntax is correct Semantics: ▪ The concept embedded in an algorithm (the soul!) Syntax: ▪ The actual representation of an algorithm (the body!) WARNINGS: 1. An algorithm can be syntactically correct, yet semantically incorrect – dangerous situation! 2. Syntactic correctness is easier to check as compared to semantic correctness
  • 14. Algorithm Summary 14 Design and Analysis of Algorithms Adnan Rashid ▪ Problem Statement ▪ Relationship between the input and output ▪ Algorithm ▪ Procedure to achieve the relationship ▪ Definition ▪ A sequence of steps that transform the input to output ▪ Instance ▪ The input needed to compute solution ▪ Correct Algorithm ▪ For every input it halts with correct output
  • 15. About Us ▪ Instructor ▪ Dr. Adnan Rashid (A-226, Faculty Block, SEECS) ▪ Contact: adnan.rashid@seecs.edu.pk ▪ Telephone: +92 51 9085 2176 ▪ Web: http://save.seecs.nust.edu.pk/adnanrashid/ https://seecs.nust.edu.pk/faculty/adnan-rashid/ 15 Design and Analysis of Algorithms Adnan Rashid
  • 16. Course Updates ▪ Updates (on LMS, Email): ▪ Updates and Discussions (on WhatsApp): https://tinyurl.com/yckj3x52 16 Design and Analysis of Algorithms Adnan Rashid
  • 17. Course Updates 17 Compiler Construction Adnan Rashid ▪ Office Hours: By appointment only (via email) ▪ Code for Course Self Enrollment on LMS: 183750294
  • 18. Class Schedule, LMS and CMS 18 Compiler Construction Adnan Rashid ▪ Consult LMS for ▪ Lecture Notes, Quizzes, Assignments and Labs ▪ Online Feedback Day BESE-12B Thursday 0900-1000 (Lecture Hall–IAEC) Thursday 1000-1100 (Lecture Hall–IAEC) Friday 1000-1100 (CR-20–SMRIMMS) ▪ Consult Qalam for ▪ Attendance and grades
  • 19. Attendance Policy 19 Compiler Construction Adnan Rashid ▪ 75-100% required at the end of semester! ▪ No compensation for attendance! ▪ Attendance will be taken at any moment
  • 20. Textbook 20 Compiler Construction Adnan Rashid ▪ Thomas H. Cormen, Introduction to Algorithms (4th edition) 2022, MIT Press
  • 21. Assessment Plan (Tentative) 21 Compiler Construction Adnan Rashid ▪ 40% Final Exam (Closed Books, Closed Notes, Comprehensive) ▪ 30% Mid Term (Closed Books, Closed Notes, Comprehensive) ▪ 10% Quizzes (Minimum 05, Surprise!) ▪ 10% Project ▪ 10% Assignments (Minimum 03)
  • 22. Homework/Assignment Policy 22 Compiler Construction Adnan Rashid ▪ All homework assignments must be done individually or as directed ▪ May also require uploading a soft-copy on LMS (for plagiarism check) ▪ Cheating ▪ Helping others, getting help, looking up websites for solutions etc. ▪ Late Submissions ▪ Late submission will get a –20% penalty up to one day ▪ -40% penalty up to 2 days (No acceptation after 2 days from deadline)
  • 23. Homework/Assignment Policy 23 Compiler Construction Adnan Rashid ▪ Any deviation from the above rule will be considered cheating and will be subject to the SEECS academic dishonesty policy ▪ Contact instructor at least 03 days before the deadline in case of emergency http://seecs.nust.edu.pk/Internal/downloads/downloads/SE ECS_Plagiarism_Policy_Dec2010_v1.0.pdf
  • 24. Lecture Basics 24 Compiler Construction Adnan Rashid ▪ Classes will mainly involve Slides ▪ Lectures (pdf) will be available on LMS ▪ However, no scribes from the class will be made available ▪ Therefore, take your own notes in the class ▪ For latest/updated slides, download before each use ▪ As I might update/correct slides at any stage
  • 25. Thank you! 25 Design and Analysis of Algorithms Adnan Rashid