Algorithms

Algorithms are instructions to solve a type of problem

What are Algorithms? 🥬 🍅🔪 🥗

Algorithms are instructions to solve a type of problem.

  1. Do "blank"

  2. Then "blank"

  3. Finally "blank"

Recipe (Algorithm) for Baking Cookies

Baking a Cake​🍰

Big O Notation: Group algorithms by their speed⏱️

  • Getting ingredients from the fridge = seconds

  • Baking the cake = minutes

  • Frosting the cake = minutes

Brute Force Algorithm: Try everything🦍

  • I don't remember grandma's recipe so i'll try

    • Every recipe on the internet

Greedy Algorithm: Chooses the best local option🤑

  • I don't remember grandma's recipe so i'll try

    • The first recipe on google

Divide & Conquer Algorithms: Convert big problems into small problems ⚔️

  • Making Grandma's Cake

    1. Call Grandma for the recipe

    2. Mom will bring the ingredients

    3. Wifey will bake the cake

    4. I will eat the cake

Sorting Algorithms: Create order🌈

  • Sort Grandma's recipe book by category: desserts, dinners, & appetizers

Search Algorithms: Finds something‌🧐

  • Look for Grandma's cake recipe in Grandma's recipe book

Last updated

Was this helpful?