Complete the following activities. You can copy the questions into your own page, but if you do, try to have your answers in a different color.
An algorithm is a set of repeated steps used in order to solve a problem.
- [ ] What algorithms do you know? Write at least 3 that you know of individually, then share and compare with the others in your group (think about your other classes - 127, 128, discrete, etc)
- Gesture Recognizer (Used to figure out different shapes from one another)
- Solving a Rubik’s Cube
- Algebraic Math Problems
- Sorting a list of stuff in an organized manner
- [ ] What is pseudocode? Pick ONE algorithm from your group, and try to -write it out in pseudocode.
- [ ] Look at the code below for Insertion Sort, written in pseudocode (note that the textbook's format may be a bit different), and see if you can figure out what it's doing (as a group)
- [ ] Insertion Sort seems to start at the beginning of the data list, and iterate through to the end of it. For each iteration, it checks if the current index is less than the one before it, and if it is, then it swaps them and makes the current index the one before it. This repeats until the current index is 0. Thus, once the algorithm is done running, it sorts the data list in increasing order.
- [ ] Trace through the code using the sample array below and write how each iteration (or pass) through the loops causes the array to change. Make sure you are writing out every pass, don’t just skip to the end 🙂