Review of 5.3 Search and 5.4 Sorting Algorithms - how can you speed up a search?
5.4 Sorting Algorithms - answer the questions and reflection questions. Once you finish get these checked off by your instructor.
Complete the Min/Max App
Create pseudo-code for an app that does the following:
1. When you click a button it creates and displays 10 random numbers
2.
When you click the Max button it displays largest number in the list of 10.
3. Add a reset button that clears the random numbers so a new list is displayed when you click the list button.
Demonstrate this app to your instructor for teacher check.
4. Now add another button that displays the smallest number in the list.
Demonstrate this app to your instructor for teacher check.
5. Create a How Many text box for the user to enter the number of random numbers they want in their list. Modify your code so each of your buttons now works with any size list of random numbers, not just one that is 10 numbers long.
Demonstrate this app to your instructor for teacher check.
6. Creating your own Bubble Sort Algorithm.
Describe how the bubble sort works - if you forgot watch the Bubble Sort video again.
You already have the app that creates a random list of 10 numbers and you already have the ability to find the highest value in that list. The next step is to go through the list incrementally and each time place the highest value in the current position. Make a sketch on paper of 10 random numbers and show what the list will look like after each step of a bubble sort.
Hints:
You will need to create a variable called temp to temporarily hold values when you switch them in the list.
You will need the Select list item procedure as well as the replace list item procedure.
You will need loops (for each procedure) to iterate through the list.
A common mistake when looping through lists is to go beyond the list length, this will crash your program. If your list has 10 items and your loop continues to 11 your program will crash so beware of this common mistatke.
Demonstrate for teacher check.