Year 11 refine Searching and sorting algorithms

Year 11 refine Searching and sorting algorithms
1 / 17
volgende
Slide 1: Tekstslide
ComputingUpper Secondary (Key Stage 4)GCSE

In deze les zitten 17 slides, met interactieve quizzen en tekstslides.

time-iconLesduur is: 60 min

Onderdelen in deze les

Year 11 refine Searching and sorting algorithms

Slide 1 - Tekstslide

Slide 2 - Tekstslide

Slide 3 - Tekstslide

Slide 4 - Tekstslide

Name all the searching algorithms you remember?

Slide 5 - Open vraag

What is a linear search?

Slide 6 - Open vraag

Slide 7 - Tekstslide

What is a binary search?

Slide 8 - Open vraag

Slide 9 - Tekstslide

Using a linear search, how many searches will be performed to find 78?

A
2
B
8
C
9
D
4

Slide 10 - Quizvraag

Using a binary search, how many searches will be performed to find 78?

A
2
B
8
C
9
D
4

Slide 11 - Quizvraag

In your books or on Word:



  • Draw the list and annotate it for a linear search
  • Order the list to perform a binary search on it and annotate it for a binary search
timer
3:00

Slide 12 - Tekstslide

no
no
no
no
yes
no
no
no
start + len[arr] // 2 (0 + 8 / 2 = 4), middle = 42, Del left half
start + len[arr] // 2 (5 + 8 // 2 = 6), middle = 74, Del left half
start + len[arr] // 2 (7 + 8 // 2 = 7), middle = 78, found 78
Total 3 searches
no higher
no higher
yes

Slide 13 - Tekstslide

What are the pros and cons of both algorithms? Write them in your books, then I will cold call using the random wheel.
timer
3:00

Slide 14 - Tekstslide

Slide 15 - Tekstslide

Slide 16 - Tekstslide

Answers

i) 1 mark each bullet point, 3 total
  • Compare to / pick out middle value (which is 6)
  • Discard only left side // retain only right side (because 6 < 10)…
  • Compare to / pick out (middle value which is) 10

ii) Data must be sorted / in order


Slide 17 - Tekstslide