Group 5 - 3.9 and 3.11
Hacks
Notes
- The three components of an algorithm are selection, sequences, and iterations.
- Algorithms can be written in different ways yet still work in teh same way.
- The flaw on the second code is that there is no “or equal to” sign for 70 so if someone has a grade of 70, nothing would print.
- When two algorithms look similar, it does not mean that they do the same exact thing
- Notes can help your future self to search for any bugs
- When creating an algorithm, it is good to outline the process before coding.
- Represent the code with a flowchart to help planning which makes the coding process more efficient.
- Selection chooses from different options
- It is important to use pre-existing algorithms as it can oftentimes make your life easier
- Binary search divides a search interval in half
- Binary search needs to put the numbers in order
- Then it needs to find the middle number
- Lists can be made with strings
- You can show binary search with a binary tree 3.9.1 Hacks why is it important to know that algorithms that look different can do the same thing and that algorithms that look the same might have different results?(0.15) It is important to know this because knowing that we can write code in different ways could save time through shortening certain parts of code. It is also important to know that different results can occur from similar code if we shift the parameters even slightly, such as removing an “or equal to” sign or shifting a number up or down.