Qu'est-ce que LessonUp
Rechercher
Canaux
aiToolsTab
Beta
Connectez-vous
S'inscrire
‹
Revenir à la recherche
11 - Binary search
Binary search
/Division and remainders
1 / 21
suivant
Slide 1:
Diapositive
Computing
Upper Secondary (Key Stage 4)
GCSE
Cette leçon contient
21 diapositives
, avec
quiz interactifs
et
diapositives de texte
.
La durée de la leçon est:
50 min
Commencer la leçon
Partager
Imprimer la leçon
Éléments de cette leçon
Binary search
/Division and remainders
Slide 1 - Diapositive
Division and Remainders
/ Division
// Floor Division
% Modulus
Slide 2 - Diapositive
Predict
Slide 3 - Diapositive
What do you think the code
will do when run?
Slide 4 - Question ouverte
RUN
Run the code
Slide 5 - Diapositive
Investigate & Modify
Using /, // and %, calculate the following questions using python
Slide 6 - Diapositive
What is 703 divided by 34 with no remainder?
A
23
B
22
C
20
D
34
Slide 7 - Quiz
What is the remainder of 703 divided by 34?
A
23
B
22
C
20
D
34
Slide 8 - Quiz
What is 90231 divided by 94?
A
959
B
959.904255319
C
90
D
85
Slide 9 - Quiz
Make
Convert minutes to hours and minutes in python
Begin by prompting the user to input the number of minutes.
Use floor division (//) to calculate the number of hours from the total minutes.
Use modulus (%) to calculate the remaining minutes after converting them into hours.
Print out the result in the format "X hours and Y minutes".
Click here for a blank createwithcode
Slide 10 - Diapositive
Solution
Run the code
Slide 11 - Diapositive
Searching activity
Slide 12 - Diapositive
Predict
Slide 13 - Diapositive
What do you think the code
will do when run?
Slide 14 - Question ouverte
Run
Click here
Slide 15 - Diapositive
Investigate and Modify
Experiment with altering the target and array's hard-coded values to investigate their effects
Replace the array, to cover a range of 1-10 using two "pointers"
Replace target's hard coded value with a user input.
Slide 16 - Diapositive
Make
Click here for a blank createwithcode
Create a program to guess a user's number 1-100
You will only tell the program if their number is higher, lower or correct.
Slide 17 - Diapositive
Number Guesser Code
Click here
Slide 18 - Diapositive
What is the main advantage of using binary search over linear search?
A
Binary search is eaiser to implement
B
Binary search usually runs faster
C
Binary search works on unsorted data
D
Binary search is more suitable for small datasets
Slide 19 - Quiz
What is the result of 17 % 5?
A
2
B
3
C
4
D
5
Slide 20 - Quiz
In binary search, what is the first step after calculating the midpoint?
A
Check if the midpoint is equal to the target
B
Update the low pointer to the midpoint
C
Update the high pointer to the midpoint.
D
Divide the searrch space into two halves.
Slide 21 - Quiz
Plus de leçons comme celle-ci
English Learning Techniques - Interactive Board Games
April 2025
- Leçon avec
13 diapositives
par
English
English
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
Further Education (Key Stage 5)
GCSE
English
Science subjects - Inspiration slides
August 2023
- Leçon avec
14 diapositives
par
LessonUp Academy
LessonUp
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
Further Education (Key Stage 5)
Higher Education (degree)
LessonUp Academy
Programming A Screen Turtle
August 2024
- Leçon avec
19 diapositives
par
Science
Computing
Primary Education
Science
Programming A Screen Turtle
December 2023
- Leçon avec
19 diapositives
par
LessonUp Inspiration
Computing
Primary Education
LessonUp Inspiration
The New(s) Year - News Quiz - Edition 2025 - 30 sec
January 2025
- Leçon avec
40 diapositives
par
LessonUp News Quiz
Pubquiz
Citizenship
+3
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
Further Education (Key Stage 5)
Higher Education (degree)
Higher Education (non-degree)
Special Education
Foundation Degree
BTEC, GCSE
LessonUp News Quiz
The New(s) Year - News Quiz - Edition 2025 - 20 sec
January 2025
- Leçon avec
40 diapositives
par
LessonUp News Quiz
Citizenship
News
+3
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
Further Education (Key Stage 5)
Higher Education (degree)
Foundation Degree
Higher Education (non-degree)
Special Education
BTEC, GCSE
LessonUp News Quiz
The New(s) Year - News Quiz - Edition 2025 - 10 sec
January 2025
- Leçon avec
40 diapositives
par
LessonUp News Quiz
Citizenship
News
+3
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
Further Education (Key Stage 5)
Higher Education (degree)
Higher Education (non-degree)
Foundation Degree
Special Education
BTEC, GCSE
LessonUp News Quiz
3. Lady Macbeth
September 2024
- Leçon avec
19 diapositives
par
English
English
Upper Secondary (Key Stage 4)
Lower Secondary (Key Stage 3)
GCSE
English