← Back to course
Code Crew G3 / Week 07 / Friday
5/6
Week 07 Β· Algorithms

Friday

// Best way to solve it

Friday: Mini-Project

Rocket finds five books on his shelf. "Let's race to sort them by pages!" he says. He starts right away.

Raven asks, "Which plan are you using?" Rocket stops. "Hmm. I don't have one yet."

Nova hovers with a timer. "Pick a plan first. Then I will time you." Let's help them sort five things and time it.

Card Sort Race

Find 5 things at home: 5 books by page-count, 5 spoons by length, 5 friends by birthday. Pick an algorithm. Sort them. Time yourself.

What I sorted: ____________________
Algorithm I used: __________________
Time: ____ sec
What I would change next time: __________________

Reflection

Sort Race Check

RACE RESULTS
  • Read the question.
  • Tap your answer.
Books have 48, 112 and 75 pages. Which has the fewest pages?
Spoons are sorted shortest to longest. Which spoon comes last?
Rocket sorted in 40 seconds. Raven took 25 with a new plan. Whose plan was faster?
Why might you pick a slower plan?
Sort 95, 40, 112 from smallest to largest. Which number is first?
Same numbers. Which number is last?
Raven took 25 seconds. Rocket took 40. How many seconds faster was Raven?
StatementTrue or false?
You can sort books by their number of pages.?
A fair race uses the same items for both plans.?
The faster plan is always the best plan.?
Sorting can go from biggest to smallest too.?
WHY THIS EXERCISEGood programmers think about speed and about how easy a plan is.
Raven sorts 4 spoons with pick the smallest. Each round, she looks at every spoon left. How many looks?
WHY THIS EXERCISECounting the steps of a plan is one way to compare algorithms.

Quick Check

SORT THE BOOKS FROM FEWEST PAGES TO MOST PAGES
  • ?Bug guide: 75 pages
  • ?Star book: 230 pages
  • ?Fox story: 112 pages
  • ?Poem book: 30 pages
  • ?Map book: 48 pages
WHY THIS EXERCISESorting by a number is a job computers do all the time. A clear algorithm makes the job quick.
← Thursday