SlideShare a Scribd company logo
“I Hear and I Forget,
I See and I Remember,
I Do and I Understand.”
- Chinese Proverb
CS 310 - ALGORITHMS
Think before you leap.
Designing an algorithm is a creative and rewarding process
Think before you leap code.
Designing an algorithm is a creative and rewarding process
“Weeks of programming can save you hours
of planning.”
- Anonymous quote
514 × 401 - courses.ischool.utexas.edu
1730 × 1155 - makeawebsitehub.com
472 × 445 - isoin.es
Intro to Algorithms - Time and Space Complexity
Algorithms make the world run!
Why Study Algorithms?
Computers are ubiquitous
Education and research
Networks (internet, local nets, ...)
Banks and commerce
Business management
Communication
Defense and military
Health Management
Medical imaging
Exploration (space, sea, land)
Data analytics
Transportation
Multimedia
Robotics
Simulations
Manufacturing
Entertainment
Governance
Security
AI and automation
Social media
…
What are Algorithms?
Intro to Algorithms - Time and Space Complexity
What are Algorithms again?
“An algorithm is a finite, definite,
effective procedure, with some
input and some output. ”
- Donald Knuth
An algorithm stays the same
whether the program is in java on
Windows or C on Linux or python
on Mac OS X.
Muhammad ibn Musa Al-Khwarizmi
formerly latinized as Algoritmi
Kitāb al-jabr wa'l-muqābala, which
evolved into today's high school
algebra text.
“Algorism”: technique of performing
arithmetic with Hindu-Arabic numerals
developed by al-Khwārizmī.
Famous 9th century Persian
mathematician, astronomer, and
geographer. (Source: Wikipedia.)
Concept of an algorithm has existed for centuries
Core computer science problems that arise
in many different applications.
- Many problems reduce to them.
What we’ll do in this course
Follow a design process using a
variety of computing problems.
What we’ll do in this course
Understand the problem.
What we’ll do in this course
Discuss design techniques based on
the structure of the problem.
What we’ll do in this course
Analyze the algorithm and discover
efficient solutions to the problem and
show it’s correct.
What we’ll do in this course
How many have not taken Data Structures?
Course Syllabus
- Algorithm Analysis
Lecture Modules
- Algorithm Analysis
- Graph Algorithms
Lecture Modules
- Algorithm Analysis
- Graph Algorithms
- Design Techniques
Lecture Modules
- Algorithm Analysis
- Graph Algorithms
- Design Techniques
- Greedy Algorithms
Lecture Modules
- Algorithm Analysis
- Graph Algorithms
- Design Techniques
- Greedy Algorithms
- Divide and Conquer
Lecture Modules
- Algorithm Analysis
- Graph Algorithms
- Design Techniques
- Greedy Algorithms
- Divide and Conquer
- Dynamic Programming
Lecture Modules
- Algorithm Analysis
- Graph Algorithms
- Design Techniques
- Greedy Algorithms
- Divide and Conquer
- Dynamic Programming
- Reductions
Lecture Modules
- Algorithm Analysis
- Graph Algorithms
- Design Techniques
- Greedy Algorithms
- Divide and Conquer
- Dynamic Programming
- Reductions
- Network Flow
Lecture Modules
- Algorithm Analysis
- Graph Algorithms
- Design Techniques
- Greedy Algorithms
- Divide and Conquer
- Dynamic Programming
- Reductions
- Network Flow
- NP Complete Problems (if time permits)
Lecture Modules
- Assignments: 25% (No-show for vivas=70% reduction)
- Quizzes, In-class problems, homework: 20%
- Midterm Examination: 25%
- Final Examination: 30%
Grading breakup
- Ali Ahad (20100284@lums.edu.pk)
- Javaria Hassan (20100058@lums.edu.pk)
- Sheikh Abdul Mannan (20100261@lums.edu.pk)
- Syed Hamza Ahmad (20100108@lums.edu.pk)
CS 310 TAs (in alphabetical order)
What should you do to succeed in this course?
Visual source: Barbara Oakley - Learning how to learn
Visual source: Barbara Oakley - Learning how to learn
Visual source: Barbara Oakley - Learning how to learn
Students who:
- Enjoy problem solving and thinking
about creative solutions
- Review material after class and
through spaced repetitions.
- Focus on understanding in-class,
homework and practice problems
- Start work on assignments early
Students who:
- Cram for exam a couple of days
before it.
- Don’t review material after class
- Waste time during class
- Don’t spend sufficient time on
problem solving
- Procrastinate on the assignments
The first time you actually understand something
is when you can do it yourself.
Come to class on time (5 minute rule)
Be an active participant.
Enjoy learning!
What should you do to succeed in this course?
What things are important in software design?
Why is performance (time) important?
How long are you willing to wait for a web page
to load?
Intro to Algorithms - Time and Space Complexity
How do we determine efficiency of an
algorithm?
Running Times of different algorithms on inputs of
increasing sizes
44

More Related Content

Similar to Intro to Algorithms - Time and Space Complexity (20)

PPTX
01 computer programming
manish aryal
 
PPT
Design and Analysis of algorithms unit 1 notes
sangeja1
 
PPTX
Algorithms and Data Structures
sonykhan3
 
PPTX
lecture1-220221114413Algorithims and data structures.pptx
smartashammari
 
PPTX
lecture1-2202211144eeeee24444444413.pptx
smartashammari
 
PPTX
DAA_Day0 (2).pptx for the presentation of the daa
ManikarthikPothula
 
PDF
Analysis of Algorithms Syllabus
Andres Mendez-Vazquez
 
PPTX
Design and Analysis of Algorithm ppt for unit one
ssuserb7c8b8
 
PDF
Algorithms notes 2 tutorials duniya
TutorialsDuniya.com
 
PDF
Design and Analysis Algorithms.pdf
HarshNagda5
 
PPTX
CH-1.1 Introduction (1).pptx
satvikkushwaha1
 
PPT
Data Structures- Part1 overview and review
Abdullah Al-hazmy
 
PPTX
GLOBAL INSTITUTE OF MANAGEMENT AND TECHNOLOGY.pptx
hemantag1989
 
PPT
Types of Algorithms.ppt
ALIZAIB KHAN
 
PDF
Data structures and algorithms Module-1.pdf
DukeCalvin
 
PDF
Lec01-Algorithems - Introduction and Overview.pdf
MAJDABDALLAH3
 
PPT
UNIT-1-PPT-DESIGN AND ANALYSIS OF ALGORITHMS
ramalakshmikaliappan
 
PDF
Design and analysis of algorithms
Dr Geetha Mohan
 
PDF
lect 1-ds algo(final)_2.pdf
MuhammadUmerIhtisham
 
PPTX
Chp-1 DAA (2).pptx design analysis and algoritham presentation
vaishnavbhavna17
 
01 computer programming
manish aryal
 
Design and Analysis of algorithms unit 1 notes
sangeja1
 
Algorithms and Data Structures
sonykhan3
 
lecture1-220221114413Algorithims and data structures.pptx
smartashammari
 
lecture1-2202211144eeeee24444444413.pptx
smartashammari
 
DAA_Day0 (2).pptx for the presentation of the daa
ManikarthikPothula
 
Analysis of Algorithms Syllabus
Andres Mendez-Vazquez
 
Design and Analysis of Algorithm ppt for unit one
ssuserb7c8b8
 
Algorithms notes 2 tutorials duniya
TutorialsDuniya.com
 
Design and Analysis Algorithms.pdf
HarshNagda5
 
CH-1.1 Introduction (1).pptx
satvikkushwaha1
 
Data Structures- Part1 overview and review
Abdullah Al-hazmy
 
GLOBAL INSTITUTE OF MANAGEMENT AND TECHNOLOGY.pptx
hemantag1989
 
Types of Algorithms.ppt
ALIZAIB KHAN
 
Data structures and algorithms Module-1.pdf
DukeCalvin
 
Lec01-Algorithems - Introduction and Overview.pdf
MAJDABDALLAH3
 
UNIT-1-PPT-DESIGN AND ANALYSIS OF ALGORITHMS
ramalakshmikaliappan
 
Design and analysis of algorithms
Dr Geetha Mohan
 
lect 1-ds algo(final)_2.pdf
MuhammadUmerIhtisham
 
Chp-1 DAA (2).pptx design analysis and algoritham presentation
vaishnavbhavna17
 

Recently uploaded (20)

PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Controller Request and Response in Odoo18
Celine George
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
Horarios de distribución de agua en julio
pegazohn1978
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Ad

Intro to Algorithms - Time and Space Complexity

  • 1. “I Hear and I Forget, I See and I Remember, I Do and I Understand.” - Chinese Proverb CS 310 - ALGORITHMS
  • 2. Think before you leap. Designing an algorithm is a creative and rewarding process
  • 3. Think before you leap code. Designing an algorithm is a creative and rewarding process
  • 4. “Weeks of programming can save you hours of planning.” - Anonymous quote
  • 5. 514 × 401 - courses.ischool.utexas.edu 1730 × 1155 - makeawebsitehub.com 472 × 445 - isoin.es
  • 7. Algorithms make the world run! Why Study Algorithms?
  • 8. Computers are ubiquitous Education and research Networks (internet, local nets, ...) Banks and commerce Business management Communication Defense and military Health Management Medical imaging Exploration (space, sea, land) Data analytics Transportation Multimedia Robotics Simulations Manufacturing Entertainment Governance Security AI and automation Social media …
  • 12. “An algorithm is a finite, definite, effective procedure, with some input and some output. ” - Donald Knuth
  • 13. An algorithm stays the same whether the program is in java on Windows or C on Linux or python on Mac OS X.
  • 14. Muhammad ibn Musa Al-Khwarizmi formerly latinized as Algoritmi Kitāb al-jabr wa'l-muqābala, which evolved into today's high school algebra text. “Algorism”: technique of performing arithmetic with Hindu-Arabic numerals developed by al-Khwārizmī. Famous 9th century Persian mathematician, astronomer, and geographer. (Source: Wikipedia.) Concept of an algorithm has existed for centuries
  • 15. Core computer science problems that arise in many different applications. - Many problems reduce to them. What we’ll do in this course
  • 16. Follow a design process using a variety of computing problems. What we’ll do in this course
  • 17. Understand the problem. What we’ll do in this course
  • 18. Discuss design techniques based on the structure of the problem. What we’ll do in this course
  • 19. Analyze the algorithm and discover efficient solutions to the problem and show it’s correct. What we’ll do in this course
  • 20. How many have not taken Data Structures?
  • 23. - Algorithm Analysis - Graph Algorithms Lecture Modules
  • 24. - Algorithm Analysis - Graph Algorithms - Design Techniques Lecture Modules
  • 25. - Algorithm Analysis - Graph Algorithms - Design Techniques - Greedy Algorithms Lecture Modules
  • 26. - Algorithm Analysis - Graph Algorithms - Design Techniques - Greedy Algorithms - Divide and Conquer Lecture Modules
  • 27. - Algorithm Analysis - Graph Algorithms - Design Techniques - Greedy Algorithms - Divide and Conquer - Dynamic Programming Lecture Modules
  • 28. - Algorithm Analysis - Graph Algorithms - Design Techniques - Greedy Algorithms - Divide and Conquer - Dynamic Programming - Reductions Lecture Modules
  • 29. - Algorithm Analysis - Graph Algorithms - Design Techniques - Greedy Algorithms - Divide and Conquer - Dynamic Programming - Reductions - Network Flow Lecture Modules
  • 30. - Algorithm Analysis - Graph Algorithms - Design Techniques - Greedy Algorithms - Divide and Conquer - Dynamic Programming - Reductions - Network Flow - NP Complete Problems (if time permits) Lecture Modules
  • 31. - Assignments: 25% (No-show for vivas=70% reduction) - Quizzes, In-class problems, homework: 20% - Midterm Examination: 25% - Final Examination: 30% Grading breakup
  • 32. - Ali Ahad ([email protected]) - Javaria Hassan ([email protected]) - Sheikh Abdul Mannan ([email protected]) - Syed Hamza Ahmad ([email protected]) CS 310 TAs (in alphabetical order)
  • 33. What should you do to succeed in this course?
  • 34. Visual source: Barbara Oakley - Learning how to learn
  • 35. Visual source: Barbara Oakley - Learning how to learn
  • 36. Visual source: Barbara Oakley - Learning how to learn Students who: - Enjoy problem solving and thinking about creative solutions - Review material after class and through spaced repetitions. - Focus on understanding in-class, homework and practice problems - Start work on assignments early Students who: - Cram for exam a couple of days before it. - Don’t review material after class - Waste time during class - Don’t spend sufficient time on problem solving - Procrastinate on the assignments
  • 37. The first time you actually understand something is when you can do it yourself.
  • 38. Come to class on time (5 minute rule) Be an active participant. Enjoy learning! What should you do to succeed in this course?
  • 39. What things are important in software design?
  • 40. Why is performance (time) important?
  • 41. How long are you willing to wait for a web page to load?
  • 43. How do we determine efficiency of an algorithm?
  • 44. Running Times of different algorithms on inputs of increasing sizes 44