-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix missing pkl file bug and use md_file in to_page
- Loading branch information
1 parent
343234d
commit f2aef2a
Showing
8 changed files
with
38 additions
and
26 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
output_tmp/expected_output/61a-sp24-mt2_sol_2_pages/61a-sp24-mt2_sol_2_pages.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
1. (7.0 points) What Would Python Display? Assume the following code has been executed. The Link class appears on the midterm 2 study guide (page 2, left side). def shake(it): if it is not Link.empty and it.rest is not Link.empty: if it.first + 1 < it.rest.first: it.rest = Link(it.rest.first-1, it.rest) shake(it) else: shake(it.rest) it = Link(2, Link(5, Link(7))) off = Link(1, it.rest) shake(it) def cruel(summer): while summer is not Link.empty: yield summer.first summer = summer.rest if summer is not Link.empty: summer = summer.rest summer = Link(1, Link(2, Link(3, Link(4)))) Write the output printed for each expression below or _Error_ if an error occurs. 1. (2.0 pt) print(it) <2 5 7> <2 4 5 7> <2 4 5 6 7> <2 3 4 5 7> <2 4 3 5 7> <2 3 4 5 6 7> <2 4 3 5 6 7> (2.0 pt) print(off) <1 5 6 7> (2.0 pt) print([x*x for x in cruel(summer)]) [1, 9] | ||
|
||
**(d) (1.0 pt)** What is the order of growth of the time it takes to evaluate shake(Link(1, Link(n))) in terms of n? | ||
|
||
exponential | ||
|
||
quadratic | ||
|
||
linear | ||
|
||
constant |
Binary file added
BIN
+142 KB
output_tmp/expected_output/61a-sp24-mt2_sol_2_pages/61a-sp24-mt2_sol_2_pages.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters