SlideShare a Scribd company logo
Algorithms
Starter Activity: Crossing Water
Open the ‘Crossing Water’ activity. It is in the
Getting Technical folder in Groupwork. ‘You need
to help the adults and children cross the water
but they can’t all go in the boat together.
Algorithms
In this lesson you will learn about algorithms and
how computers use them. You will write a simple
algorithm, perform a simple and selection sort
and determine which one is the most efficient.
Lesson
Objectives
 Understand the purpose of an algorithm
 Be able to create simple algorithms using English
 Be able to complete simple and selection sorts
 Be able to compare algorithms for efficiency
Algorithms
Algorithms
Watch the Algorithms video, this will introduce you
to how algorithms works.
Algorithms
Algorithms
•An algorithm is a precise set of instructions for
completing a task
•Every time you follow a series of step by step
actions you are using an algorithm
•Starting a car, getting dressed, logging into your
computer are all completed using an algorithm
•Computers use algorithms that people have written
to solve all kinds of tasks for example to search for
documents or to sort your documents
Algorithms
Example Algorithm
Here is an algorithm for making a pot of tea:
1.If the kettle does not contain water then fill the kettle
2.Plug the kettle into the plug socket and turn on
3.If the teapot is not empty then empty teapot
4.Place tea bag in the teapot
5.If the water in the kettle is not boiling then go to step 5
6.Switch the kettle off
7.Pour water from the kettle into the teapot
Algorithms
Task 9: Ice Lolly Algorithm
Write an algorithm for making ice lollies out of
water and fruit cordial.
Algorithms
Simple Sort Algorithm
Watch the Simple Card Sort animation, this will
illustrate a simple sort algorithm.
Algorithms
Task 10: Simple Card Sort
1.You will be given a hand of unsorted cards
2.Repeat steps 3 through 5 until the unsorted hand
is empty
3.Compare unsorted cards
4.Select the smallest unsorted card
5.Move this card to the sorted hand
6.Stop
Algorithms
Computer - Simple Card Sort
Computers will carry out similar sorts but with
numbers rather than cards. The computer would
find the smallest number and then copy it to a new
list called an array. The original number would be
replaced with a special number called MAX. No
number can be greater than MAX. This process
would be repeated until all the numbers have been
considered and the array was sorted.
Algorithms
Selection Sort Algorithm
Watch the Selection Card Sort animation, this will
illustrate a selection sort algorithm.
Algorithms
Task 11: Selection Card Sort
1.You will be given a hand of unsorted cards
2.Use a pen to set a marker for the unsorted section at the front of
the hand
3.Repeat steps 4 through 7 until one card remains in the unsorted
section
4.Compare all unsorted cards
5.Select the smallest unsorted card
6.Swap this number with the first card in the unsorted section
7.Advance the marker to the right one card
8.Stop
Algorithms
Computer - Selection Sort
The computer would add a marker at the beginning
of the array of unsorted numbers. To sort the
numbers, the computer would repeatedly search
the unsorted section for the smallest number, swap
this number with the first number in the unsorted
section and advance the sort marker. This process
would be repeated until there was only one
number in the unsorted section. At this point the
list of numbers will be sorted.
Algorithms
Efficiency of Algorithms
The efficiently of algorithms can be measured by
calculating:
1.The amount of memory they use
2.The amount of copying, comparing and swapping
of numbers
Algorithms
Which Sort Algorithm is the Best?
1.As the selection sort swaps the numbers rather
than copying them into a new list it uses memory
than the simple sort.
2.Since the simple sort does not swap numbers it
would perform the least number of copies however,
it would perform twice as many comparisons as the
selection sort.
3.It is difficult to say which algorithm is the best as it
all depends on the original list, because of this
algorithms are measured on a worst case basis.
Algorithms
Task 12: Most Efficient Algorithm
Analyse the figures below to find out which sort is
the most efficient. The figures are all based on
worst case. Write-up your findings and justify your
decision.
Algorithms
No of Items Simple Selection
10 90 45
100 9,900 4,950
1000 999,000 499,500
10000 99,990,000 49,995,000
No of Items Simple Selection
10 10 27
100 100 297
1000 1,000 2,997
10000 10,000 29,997
Copies RequiredComparisons Required
Plenary: Alien Message
Write a short message to an alien explaining what
you have learnt in todays lesson. They only
understand basic English so think carefully about
the terminology you use.
Algorithms
Keywords
 Understand the purpose of an algorithm
 Be able to create simple algorithms using English
 Be able to complete simple and selection sorts
 Be able to compare algorithms for efficiency
Objectives
 Algorithm
 Instructions
 Sort
 Array
 Marker
 Memory
 Simple
 Selection




Algorithms

More Related Content

PPTX
Chap3 calculation
PPTX
Powerpoint foruseofcalculator
PPTX
Presentation flow diagrams exercises
PPTX
8calc7
PPTX
What is an algorithm?
PPTX
Validation and Over fitting , Validation strategies
PDF
4.13 pdf
PPT
Numerical approximation and solution of equations
Chap3 calculation
Powerpoint foruseofcalculator
Presentation flow diagrams exercises
8calc7
What is an algorithm?
Validation and Over fitting , Validation strategies
4.13 pdf
Numerical approximation and solution of equations

Viewers also liked (13)

PDF
AD_International_Surface Treatment and Manufacturing_DEF
PDF
Andalucía jornalera
DOC
Päihdestrategia 2013
PDF
Introdução à Telefonia IP
PPT
Hyperlinks and Evaluation
PPT
Creating your first web page
PDF
TPS DAS K9-SAR_redact
PDF
Elastix 1 o1 introduccion
PDF
Elastix lab ece-book-esp(2)
PDF
Frokostseminar 26 mai: Hvordan temme det store innholdsdyret?
PPTX
What we carry from this planet arise roby
PPTX
Estruturas externa-e-interna de "Frei Luís de Sousa"
PPTX
Metodo AIDA - Definición y Apliciacion
AD_International_Surface Treatment and Manufacturing_DEF
Andalucía jornalera
Päihdestrategia 2013
Introdução à Telefonia IP
Hyperlinks and Evaluation
Creating your first web page
TPS DAS K9-SAR_redact
Elastix 1 o1 introduccion
Elastix lab ece-book-esp(2)
Frokostseminar 26 mai: Hvordan temme det store innholdsdyret?
What we carry from this planet arise roby
Estruturas externa-e-interna de "Frei Luís de Sousa"
Metodo AIDA - Definición y Apliciacion
Ad

Similar to Algorithms (20)

PPTX
Design and Analysis of Algorithm ppt for unit one
PDF
Algorithm Design and Analysis
PDF
Unit 1-problem solving with algorithm
PPTX
Data calculatio. Algorithms by Charlotte.pptx
PPT
Systems in the small - Introduction to Algorithms
PDF
Algorithms Lecture 1: Introduction to Algorithms
PPTX
Algorithms.pptx
PPTX
Lecture 1.pptx
PPTX
Sorting algorithms
PPTX
Segment_1_New computer algorithm for cse.pptx
PPTX
Binary to hexadecimal algorithmic old.pptx
PPTX
Algorithm_Presentation_Ixjkmcfsdnm,vznkslds,nf
PPTX
FDFDRERSFDSGAGAFGGFGFGFGFGAFDGFDGFGFFAGFGGDF
PPTX
Lecture-1-Algorithms.pptx
PPTX
Algorithm By AMT.pptx
PDF
Algorithms notes 2 tutorials duniya
PPTX
CubeIT Tech - Algorithms
PPTX
Lesson 1 - Introduction to Algorithms.pptx
PPTX
Solving Problems with Algorithms, making things simple
PDF
Design and Analysis of Algorithm ppt for unit one
Algorithm Design and Analysis
Unit 1-problem solving with algorithm
Data calculatio. Algorithms by Charlotte.pptx
Systems in the small - Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
Algorithms.pptx
Lecture 1.pptx
Sorting algorithms
Segment_1_New computer algorithm for cse.pptx
Binary to hexadecimal algorithmic old.pptx
Algorithm_Presentation_Ixjkmcfsdnm,vznkslds,nf
FDFDRERSFDSGAGAFGGFGFGFGFGAFDGFDGFGFFAGFGGDF
Lecture-1-Algorithms.pptx
Algorithm By AMT.pptx
Algorithms notes 2 tutorials duniya
CubeIT Tech - Algorithms
Lesson 1 - Introduction to Algorithms.pptx
Solving Problems with Algorithms, making things simple
Ad

More from cachs_computing (20)

PPT
It and computing assessment
PPT
Forest archery game
PPT
Scratching the surface
PPT
Introduction
PPT
Desktop publishing
PPT
Spreadsheets
PPT
Internet
PPT
Getting technical introduction
PPT
It and computing assessment
PPT
Introduction
PPT
Word processing 2
PPT
Word processing 1
PPT
Desktop publishing
PPT
Spreadsheets
PPT
Introduction functional skills
PPT
Internet
PPT
Search engines
PPT
Fetch execute cycle
PPT
Sounds and images
PPT
It and computing assessment
Forest archery game
Scratching the surface
Introduction
Desktop publishing
Spreadsheets
Internet
Getting technical introduction
It and computing assessment
Introduction
Word processing 2
Word processing 1
Desktop publishing
Spreadsheets
Introduction functional skills
Internet
Search engines
Fetch execute cycle
Sounds and images

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Machine Learning_overview_presentation.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation_ Review paper, used for researhc scholars
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Machine learning based COVID-19 study performance prediction
Machine Learning_overview_presentation.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
A comparative analysis of optical character recognition models for extracting...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25-Week II
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation_ Review paper, used for researhc scholars

Algorithms

  • 2. Starter Activity: Crossing Water Open the ‘Crossing Water’ activity. It is in the Getting Technical folder in Groupwork. ‘You need to help the adults and children cross the water but they can’t all go in the boat together. Algorithms
  • 3. In this lesson you will learn about algorithms and how computers use them. You will write a simple algorithm, perform a simple and selection sort and determine which one is the most efficient. Lesson Objectives  Understand the purpose of an algorithm  Be able to create simple algorithms using English  Be able to complete simple and selection sorts  Be able to compare algorithms for efficiency Algorithms
  • 4. Algorithms Watch the Algorithms video, this will introduce you to how algorithms works. Algorithms
  • 5. Algorithms •An algorithm is a precise set of instructions for completing a task •Every time you follow a series of step by step actions you are using an algorithm •Starting a car, getting dressed, logging into your computer are all completed using an algorithm •Computers use algorithms that people have written to solve all kinds of tasks for example to search for documents or to sort your documents Algorithms
  • 6. Example Algorithm Here is an algorithm for making a pot of tea: 1.If the kettle does not contain water then fill the kettle 2.Plug the kettle into the plug socket and turn on 3.If the teapot is not empty then empty teapot 4.Place tea bag in the teapot 5.If the water in the kettle is not boiling then go to step 5 6.Switch the kettle off 7.Pour water from the kettle into the teapot Algorithms
  • 7. Task 9: Ice Lolly Algorithm Write an algorithm for making ice lollies out of water and fruit cordial. Algorithms
  • 8. Simple Sort Algorithm Watch the Simple Card Sort animation, this will illustrate a simple sort algorithm. Algorithms
  • 9. Task 10: Simple Card Sort 1.You will be given a hand of unsorted cards 2.Repeat steps 3 through 5 until the unsorted hand is empty 3.Compare unsorted cards 4.Select the smallest unsorted card 5.Move this card to the sorted hand 6.Stop Algorithms
  • 10. Computer - Simple Card Sort Computers will carry out similar sorts but with numbers rather than cards. The computer would find the smallest number and then copy it to a new list called an array. The original number would be replaced with a special number called MAX. No number can be greater than MAX. This process would be repeated until all the numbers have been considered and the array was sorted. Algorithms
  • 11. Selection Sort Algorithm Watch the Selection Card Sort animation, this will illustrate a selection sort algorithm. Algorithms
  • 12. Task 11: Selection Card Sort 1.You will be given a hand of unsorted cards 2.Use a pen to set a marker for the unsorted section at the front of the hand 3.Repeat steps 4 through 7 until one card remains in the unsorted section 4.Compare all unsorted cards 5.Select the smallest unsorted card 6.Swap this number with the first card in the unsorted section 7.Advance the marker to the right one card 8.Stop Algorithms
  • 13. Computer - Selection Sort The computer would add a marker at the beginning of the array of unsorted numbers. To sort the numbers, the computer would repeatedly search the unsorted section for the smallest number, swap this number with the first number in the unsorted section and advance the sort marker. This process would be repeated until there was only one number in the unsorted section. At this point the list of numbers will be sorted. Algorithms
  • 14. Efficiency of Algorithms The efficiently of algorithms can be measured by calculating: 1.The amount of memory they use 2.The amount of copying, comparing and swapping of numbers Algorithms
  • 15. Which Sort Algorithm is the Best? 1.As the selection sort swaps the numbers rather than copying them into a new list it uses memory than the simple sort. 2.Since the simple sort does not swap numbers it would perform the least number of copies however, it would perform twice as many comparisons as the selection sort. 3.It is difficult to say which algorithm is the best as it all depends on the original list, because of this algorithms are measured on a worst case basis. Algorithms
  • 16. Task 12: Most Efficient Algorithm Analyse the figures below to find out which sort is the most efficient. The figures are all based on worst case. Write-up your findings and justify your decision. Algorithms No of Items Simple Selection 10 90 45 100 9,900 4,950 1000 999,000 499,500 10000 99,990,000 49,995,000 No of Items Simple Selection 10 10 27 100 100 297 1000 1,000 2,997 10000 10,000 29,997 Copies RequiredComparisons Required
  • 17. Plenary: Alien Message Write a short message to an alien explaining what you have learnt in todays lesson. They only understand basic English so think carefully about the terminology you use. Algorithms
  • 18. Keywords  Understand the purpose of an algorithm  Be able to create simple algorithms using English  Be able to complete simple and selection sorts  Be able to compare algorithms for efficiency Objectives  Algorithm  Instructions  Sort  Array  Marker  Memory  Simple  Selection     Algorithms