# Algorithms

## What are Algorithms? :leafy\_green: :tomato::knife: :salad:&#x20;

**Algorithms** are instructions to solve a type of problem.

1. Do "blank"
2. Then "blank"&#x20;
3. Finally "blank"

&#x20;

![Recipe (Algorithm) for Baking Cookies](https://3642656209-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLGBprg9M6rsaEbC96_%2F-MMH_5aIqbbJr-7FCeoq%2F-MMHaM44M6_SDP3dG8sZ%2Fmonika-grabkowska-neu4T59mTcY-unsplash.jpg?alt=media\&token=14916942-a8f0-4240-a39d-383a1abfa59c)

## Baking a Cake​:cake:

**Big O Notation:** Group algorithms by their speed:stopwatch:

* Getting ingredients from the fridge = seconds
* Baking the cake = minutes
* Frosting the cake = minutes

**Brute Force Algorithm:** Try everything:gorilla:

* I don't remember grandma's recipe so i'll try
  * Every recipe on the internet&#x20;

**Greedy Algorithm:** Chooses the best local option:money\_mouth:

* 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:heavy\_division\_sign: :crossed\_swords:&#x20;

* 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:rainbow:

* Sort Grandma's recipe book by category: desserts, dinners, & appetizers&#x20;

**Search Algorithms:** Finds something‌:face\_with\_monocle:

* Look for Grandma's cake recipe in Grandma's recipe book&#x20;
