
Linear Search
Presentation
•
Computers
•
9th - 10th Grade
•
Practice Problem
•
Medium
Chris CHA
Used 5+ times
FREE Resource
3 Slides • 7 Questions
1
Linear Search
2
Linear Search Algorithm
sports = ["soccer", "hockey", "basketball", "archery"]
When data is unsorted, the sensible option when searching for a particular item is to start at the beginning and look at every item until you find the one you want. You could be lucky and find it quickly if it's near the front of the list or you may need to wait if it's near the back.
This is a LINEAR SEARCH.
3
Study this code and answer the questions on the next few slides.
Linear Search
4
Multiple Choice
What is the best description for what happens to found and index in this snippet?
They are initialised
They are evaluated
They are discarded
They are mutated
5
Multiple Choice
What is the best description of the control structures in this code snippet?
An iteration with another iteration nested inside.
A sequence of selections and a nested iteration.
An iteration with two selections inside
A selection with two iterations nested inside
6
Multiple Select
What happens to the index variable on each iteration of the REPEAT...UNTIL loop?
It's value does not change
It is used to determine which element of the list is examined
It is used to determine if there are no more elements left in the list to examine
It is increased by 1 on each iteration
7
Multiple Choice
list = ["Tim", "Kate", "Ali", "Gayle"]
If target is "Gayle", what would be the value of index when found is assigned the value True?
4
3
2
1
8
Multiple Choice
What is the best description for this selection block?
Compares index to list length to see if the loop has reached the end of the list. It will exit the loop using BREAK
Compares index to target to see if the loop has become less than the length of the list. It will BREAK from looping until the target is found.
Compares index to list length then BREAKs into another iteration and selection until the target is found.
Compares index to list length and then BREAKS the processor in half demanding that target is found.
9
Multiple Choice
What is the best description for this selection block?
If the list item at the current index is the same as the target it BREAKS out of the loop
If the list item at the current index is not the same as the target it BREAKS out of the loop and sets found to False
If the list item at the current index is the same as the target it BREAKS out of the loop and sets found to True
If the list item at the current index is the same as the target it sets found to True and then BREAKS out of the loop
10
Multiple Choice
list = ["Jim", "Barolo", "Guiseppe", "Arlan"]
If target was Barolo, what would the output be?
Target not found in the list
Target found at index index
Target found at index 0
Target found at index 1
Linear Search
Show answer
Auto Play
Slide 1 / 10
SLIDE
Similar Resources on Wayground
10 questions
KABEL LAN
Presentation
•
10th Grade
7 questions
E-safety
Presentation
•
9th Grade
8 questions
sorting
Presentation
•
10th Grade
6 questions
Infographic Elements
Presentation
•
9th - 10th Grade
10 questions
Geometry Medians and Altitudes
Presentation
•
9th - 10th Grade
8 questions
Descriptions
Presentation
•
9th Grade
9 questions
Graphing Linear Inequlities
Presentation
•
8th - 10th Grade
10 questions
Earths Interior
Presentation
•
9th - 10th Grade
Popular Resources on Wayground
15 questions
Grade 3 Simulation Assessment 1
Quiz
•
3rd Grade
22 questions
HCS Grade 4 Simulation Assessment_1 2526sy
Quiz
•
4th Grade
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
20 questions
Math Review
Quiz
•
3rd Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
20 questions
Inventor Terms Exercise #1a
Quiz
•
9th Grade
31 questions
Inventor Vocabulary Review Sheet
Quiz
•
9th Grade
10 questions
Exploring Cybersecurity Techniques and Threats
Interactive video
•
6th - 10th Grade