WELCOME TO ENGLISH CLASS
WELCOME TO ENGLISH CLASS
“Set your goals high, and don't stop till you get there.
Bo Jackson”
Classical algorithms: searching and sorting.
DATE
DATE
Objective :
Students will be able to categorize real-life situations into
different types of algorithms (such as Searching and Sorting).
AGENDA
WARM UP:
Classical algorithms: searching and sorting.
CLASS ACTIVITY:
• New Vocabulary
• Reading Strategy: Rereading
• Reading: Top Algorithms You Really Need To Know
• Wrap- Up:
• Read the following situations and figure out which of the
three algorithms you have to use in each situation: linear
search, binary search or MergeSort.
WARM-UP
Do the following tasks:
1. Order these countries from the smallest to the biggest:
Colombia Vatican Russia India
2. Order these subjects alphabetically:
Mathematics Physics Biology Spanish
3. Find the action movie in this list:
Titanic Conjuring ET Transformers
VOCABULARY
search busqueda
sort clasificar
each cada
until hasta
input aporte
find encontrar
ordered ordenado
height altura
middle medio
Match the vocabulary word with the antonym.
1. Search………………. Antonym Antonym Antonym
2. Sort………………….. Abandon disorder none
3. Each…………………
4. Until……………….. Later whole output
5. Input………………. lose disorganized length
6. Find…………………
7. Ordered…………………….
8. Height………………………
9. Middle………………………….
Video Reading Strategy
https://youtu.be/c9cpsFV9GOo
Text Top Algorithms You Really Need To Know
If you want to become a software engineer, the most basic thing that you have to learn are
algorithms and data structures. The more algorithms and data structures you learn, the more useful
they will be in your career as a software engineer. To start, let’s learn Search and Sort, two classes of
algorithms a programmer can’t live without. *stop*
Searching
There are two categories of search algorithms we will study: linear and binary.
Linear search
Linear search algorithms means that the program will look at each item in the line (=input) until it
finds the necessary item. *stop* If you have 100 items and you need to search for one specific item,
then you have to look at every item in the input before you find the necessary item. Linear = simple.
*stop* For example: imagine you want to find your friend Maria in a line of people standing in no
particular order. You already know Maria´s appearance, so you have to look at each person, one by
one, in sequence, until you recognize Maria. In doing so, you follow the linear search algorithm.
*stop*
Text Top Algorithms You Really Need To Know
Binary search
Binary search (binary - “relating to 2 things”) works by dividing the input into two parts until it finds the
necessary item. *stop* One part contains the necessary item and the other part does not. It is faster than
linear search, but it only works with ordered sequences – and this is very important, because the linear
search does not need an ordered sequence. *stop* For example: imagine you’re want to find your friend
John (who is 170 cm tall) in a line of people ordered by height from left to right, shortest to tallest. It is a
very long line, and you do not have time to go one-by-one like with the linear search. What can you do?
Use binary search. You select the person in the middle of the line, and measure their height. The person
is 165 cm tall. You immediately know that this person, and all the people on their left, is not John. *stop*
Next, you turn your attention to the people on the right and select the middle person again. The person is
172 cm tall. You can eliminate that person and all the people on the right. And so on, until you find the
person who is 170 cm tall – and that is John. In doing so, you follow the binary search algorithm. *stop*
Text Top Algorithms You Really Need To Know
Sorting
Sorting is a synonym of ordering. It is one of the most common programming tasks. We will look at
one type of sorting - MergeSort. *stop*
MergeSort
Imagine you have an unordered group of people, and you need to order them by height. First, you
divide the group in two; then you divide each of the two groups in two again, and so on – until you
have individuals. *stop* Second, you put individuals in pairs; you put the taller person to the right,
until you organize all the pairs. Next, you put pairs in groups of four, and order them. *stop*After
that, you put the groups of four into groups of eight. And so on, until you have a complete line of
people ordered by height. By doing so, you follow the MergeSort algorithm. *stop*
WRAP-UP
Read the following situations and figure out which of the three
algorithms you have to use in each situation: linear search, binary
search or MergeSort.
1. There are 30 students in class. You need them to stand in a line
according to their age, from the youngest to the oldest, from right
to left.
2. You have 15 circles that are ordered in the line from the smallest
(2 cm diameter) to the biggest (50 cm diameter). You need to find
the circle that is 22 cm in diameter.
3. You are in a supermarket, and your mother asked you to buy
coffee that is called “Super Delicious Coffee”.
4. You are in the library, in the section of “Original English Literature”.
There are 100 books that are ordered alphabetically. You need to
find “Harry Potter and the Order of Phoenix”.
5. There are 10 people in a bank. The oldest people have a priority.
You need to make a line of people taking into account the priority:
oldest person first, youngest person last.
SELF-EVALUATION
Answer the following questions:
1. Entiendo qué es “linear search”.
Si No Tal vez
2. Entiendo qué es “binary search”.
Si No Tal vez
3. Entiendo qué es MergeSort.
Si No Tal vez
4. Entiendo cómo utilizar la estrategia “rereading”.
Si No Tal vez
5. La estrategia “rereading” me ayuda a estar más consciente de
mi comprensión lectora.
Si No Tal vez