SlideShare a Scribd company logo
1 of 18
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

Viewers also liked

AD_International_Surface Treatment and Manufacturing_DEF
AD_International_Surface Treatment and Manufacturing_DEFAD_International_Surface Treatment and Manufacturing_DEF
AD_International_Surface Treatment and Manufacturing_DEFRoland Schellen
 
Introdução à Telefonia IP
Introdução à Telefonia IPIntrodução à Telefonia IP
Introdução à Telefonia IPIP10
 
Hyperlinks and Evaluation
Hyperlinks and EvaluationHyperlinks and Evaluation
Hyperlinks and Evaluationcachs_computing
 
Creating your first web page
Creating your first web pageCreating your first web page
Creating your first web pagecachs_computing
 
Frokostseminar 26 mai: Hvordan temme det store innholdsdyret?
Frokostseminar 26 mai: Hvordan temme det store innholdsdyret?Frokostseminar 26 mai: Hvordan temme det store innholdsdyret?
Frokostseminar 26 mai: Hvordan temme det store innholdsdyret?Creuna
 
What we carry from this planet arise roby
What we carry from this planet   arise robyWhat we carry from this planet   arise roby
What we carry from this planet arise robyArise Roby
 
Estruturas externa-e-interna de "Frei Luís de Sousa"
Estruturas externa-e-interna de "Frei Luís de Sousa"Estruturas externa-e-interna de "Frei Luís de Sousa"
Estruturas externa-e-interna de "Frei Luís de Sousa"Maria Góis
 
Metodo AIDA - Definición y Apliciacion
Metodo AIDA - Definición y ApliciacionMetodo AIDA - Definición y Apliciacion
Metodo AIDA - Definición y ApliciacionTodo Mkt
 

Viewers also liked (13)

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

Similar to Algorithms

Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithmrajkumar1631010038
 
GRADE 6 ALGORITHM.pptx
GRADE 6 ALGORITHM.pptxGRADE 6 ALGORITHM.pptx
GRADE 6 ALGORITHM.pptxAllanGuevarra1
 
ALGORITHM.pptx
ALGORITHM.pptxALGORITHM.pptx
ALGORITHM.pptxMdAkram73
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithmJIMS LAJPAT NAGAR
 
DA lecture 3.pptx
DA lecture 3.pptxDA lecture 3.pptx
DA lecture 3.pptxSayanSen36
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingNuzhat Memon
 
Search and Sort algorithms. Bubble, Insertion, Selection.
Search and Sort algorithms. Bubble, Insertion, Selection.Search and Sort algorithms. Bubble, Insertion, Selection.
Search and Sort algorithms. Bubble, Insertion, Selection.FerryKemperman
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and FlowchartsSabik T S
 
11 Unit 1 Problem Solving Techniques
11  Unit 1 Problem Solving Techniques11  Unit 1 Problem Solving Techniques
11 Unit 1 Problem Solving TechniquesPraveen M Jigajinni
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sitSaurabh846965
 
Small Basic Calculator Apps lesson
Small Basic Calculator Apps lessonSmall Basic Calculator Apps lesson
Small Basic Calculator Apps lessonEdujetage
 
Introduction To Algorithms
Introduction To AlgorithmsIntroduction To Algorithms
Introduction To AlgorithmsSpotle.ai
 
"A short and knowledgeable concept about Algorithm "
"A short and knowledgeable concept about Algorithm ""A short and knowledgeable concept about Algorithm "
"A short and knowledgeable concept about Algorithm "CHANDAN KUMAR
 
Csallner algorithms1
Csallner algorithms1Csallner algorithms1
Csallner algorithms1seshagiri rao
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow chartsPraveen M Jigajinni
 
Data Structures and Algorithm - Module 1.pptx
Data Structures and Algorithm - Module 1.pptxData Structures and Algorithm - Module 1.pptx
Data Structures and Algorithm - Module 1.pptxEllenGrace9
 

Similar to Algorithms (20)

Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
GRADE 6 ALGORITHM.pptx
GRADE 6 ALGORITHM.pptxGRADE 6 ALGORITHM.pptx
GRADE 6 ALGORITHM.pptx
 
daa unit 1.pptx
daa unit 1.pptxdaa unit 1.pptx
daa unit 1.pptx
 
ALGORITHM.pptx
ALGORITHM.pptxALGORITHM.pptx
ALGORITHM.pptx
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithm
 
DA lecture 3.pptx
DA lecture 3.pptxDA lecture 3.pptx
DA lecture 3.pptx
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem Solving
 
Search and Sort algorithms. Bubble, Insertion, Selection.
Search and Sort algorithms. Bubble, Insertion, Selection.Search and Sort algorithms. Bubble, Insertion, Selection.
Search and Sort algorithms. Bubble, Insertion, Selection.
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
11 Unit 1 Problem Solving Techniques
11  Unit 1 Problem Solving Techniques11  Unit 1 Problem Solving Techniques
11 Unit 1 Problem Solving Techniques
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
 
Min card lesson
Min card lessonMin card lesson
Min card lesson
 
Small Basic Calculator Apps lesson
Small Basic Calculator Apps lessonSmall Basic Calculator Apps lesson
Small Basic Calculator Apps lesson
 
Introduction To Algorithms
Introduction To AlgorithmsIntroduction To Algorithms
Introduction To Algorithms
 
"A short and knowledgeable concept about Algorithm "
"A short and knowledgeable concept about Algorithm ""A short and knowledgeable concept about Algorithm "
"A short and knowledgeable concept about Algorithm "
 
Csallner algorithms1
Csallner algorithms1Csallner algorithms1
Csallner algorithms1
 
Decision Tree.pptx
Decision Tree.pptxDecision Tree.pptx
Decision Tree.pptx
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow charts
 
Data Structures and Algorithm - Module 1.pptx
Data Structures and Algorithm - Module 1.pptxData Structures and Algorithm - Module 1.pptx
Data Structures and Algorithm - Module 1.pptx
 

More from cachs_computing (20)

It and computing assessment
It and computing assessmentIt and computing assessment
It and computing assessment
 
Forest archery game
Forest archery gameForest archery game
Forest archery game
 
Scratching the surface
Scratching the surfaceScratching the surface
Scratching the surface
 
Introduction
IntroductionIntroduction
Introduction
 
Desktop publishing
Desktop publishingDesktop publishing
Desktop publishing
 
Spreadsheets
SpreadsheetsSpreadsheets
Spreadsheets
 
Internet
InternetInternet
Internet
 
Getting technical introduction
Getting technical introductionGetting technical introduction
Getting technical introduction
 
It and computing assessment
It and computing assessmentIt and computing assessment
It and computing assessment
 
Introduction
IntroductionIntroduction
Introduction
 
Word processing 2
Word processing 2Word processing 2
Word processing 2
 
Word processing 1
Word processing 1Word processing 1
Word processing 1
 
Desktop publishing
Desktop publishingDesktop publishing
Desktop publishing
 
Spreadsheets
SpreadsheetsSpreadsheets
Spreadsheets
 
Introduction functional skills
Introduction functional skillsIntroduction functional skills
Introduction functional skills
 
Internet
InternetInternet
Internet
 
Search engines
Search enginesSearch engines
Search engines
 
Fetch execute cycle
Fetch execute cycleFetch execute cycle
Fetch execute cycle
 
Sounds and images
Sounds and imagesSounds and images
Sounds and images
 
Binary
BinaryBinary
Binary
 

Recently uploaded

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Recently uploaded (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

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