Skip to content

Commit 0920123

Browse files
committed
Update templates for reflection and worksheet.
1 parent ffef759 commit 0920123

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Name>
2+
<Date>
3+
<Title>
4+
5+
6+
1.) Describe how you used multiple quantitative methods, techniques and
7+
algorithms to add functionality to your program. How did you decide what
8+
method to use? For example, how did you use lists? “If” statements? Loops?
9+
Classes? Functions? Sample pieces of code? How did you decide which methods
10+
to apply? Feel free to give examples.
11+
12+
13+
2.) Explain how you communicate your solution (from one programmer to another)
14+
when writing the code. Show how variable names matter, how function names
15+
matter, how comments and structure make your code easier to read.
16+
17+
18+
3.) How did you test and evaluate the accuracy of your code? When something
19+
didn’t work, describe how you debugged what the error was. Also, how do you
20+
determine if data returned is correct data?
21+
22+
23+
4.) What are the limitations to using numerical methods to make decisions?
24+
For example, why can’t we just replace humans with algorithms? Why can’t we
25+
just evaluate students based solely on test scores? Why can’t we evaluate
26+
teachers just on how their students do? What is the limitation to evaluating
27+
athletes just on their stats?
28+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<name>
2+
<date>
3+
4+
1. Write code to swap the values 25 and 40.
5+
6+
my_list = [55, 41, 52, 68, 45, 27, 40, 25, 37, 26]
7+
8+
2. Write code to swap the values 2 and 27.
9+
10+
my_list = [27, 32, 18, 2, 11, 57, 14, 38, 19, 91]
11+
12+
3. Why does the following code not work? Explain it, don't just list working code.
13+
14+
my_list = [70, 32, 98, 88, 92, 36, 81, 83, 87, 66]
15+
temp = my_list[0]
16+
my_list[1] = my_list[0]
17+
my_list[0] = temp
18+
19+
4. Show how the following numbers can be sorted using the selection sort. Show
20+
the numbers after each iteration of the outer loop, similar to what is shown in
21+
the book. I am NOT looking for a copy of the code to do the sort. If you include
22+
any code for problems 4-7 you are doing it wrong.
23+
24+
97 74 8 22 47 92 18 11 0 60
25+
26+
5. Show how the following numbers can be sorted using the selection sort:
27+
28+
73 92 28 47 30 58 0 36 31 25
29+
30+
6. Show how the following numbers can be sorted using the INSERTION sort.
31+
(Note: If you think the 0 gets immediately sorted into position, you are doing
32+
it wrong. Go back and re-read how this sort works.)
33+
34+
97 74 8 22 47 92 18 11 0 60
35+
36+
7. Show how the following numbers can be sorted using the insertion sort:
37+
38+
73 92 28 47 30 58 0 36 31 25
39+
40+
8. Explain what `min_pos` does in the selection sort.
41+
42+
9. Explain what `cur_pos` does in the selection sort.
43+
44+
10. Explain what `scan_pos` does in the selection sort.
45+
46+
11. Explain what `key_pos` and `key_value` are in the insertion sort.
47+
48+
12. Explain `scan_pos` in the insertion sort.
49+
50+
13. Look at the example sort program at the very end of this chapter:
51+
52+
https://learn.arcade.academy/en/latest/chapters/30_sorting/sorting.html
53+
54+
Modify the sorts to print the number of times the inside loop is run, and the
55+
number of times the outside loop is run. Modify the program to work with a list
56+
of 100. Paste the code you used here. Run the program and list the numbers you
57+
got here. (DON'T FORGET TO INCLUDE THE RESULTS!) Inside loop for selection sort
58+
should be about 5,000, and insertion sort 2,500. Double-check if you don't get
59+
numbers close to these.

0 commit comments

Comments
 (0)