Searching and Sorting
Finding and arranging data
Searching
Searching means looking for a particular item in data. A simple search checks items one by one until it finds the target.
Sorting
Sorting means arranging items in an order, such as smallest to largest or alphabetical order.
Why these ideas matter
Search and sort ideas appear in contact lists, shopping apps, libraries, maps, and many other systems.
What does sorting mean?
Sorting puts items into a chosen order.
Correct answer: Arranging items in order
What is searching?
Searching tries to locate a target value or item.
Correct answer: Looking for a particular item in data
Simple linear search
-
1
Step 1: Start at the first item.
-
2
Step 2: Compare each item with the target.
-
3
Step 3: Stop when the target is found or the list ends.
Which task is an example of searching?
Looking for a name in a list is searching.
Correct answer: Looking through a list for a name
Why might a sorted list be useful?
Sorted data is easier to navigate and sometimes faster to search.
Correct answer: It can make finding items easier and more organized