{"assignment":{"_schema_version":2,"course_id":37,"date_created":"2022-06-28T19:00:00+00:00","date_modified":"2022-11-14T19:22:32.220238+00:00","extra_instructor_files":"","extra_starting_files":"","forked_id":null,"forked_version":null,"hidden":false,"id":1164,"instructions":"{\n  \"settings\": {\n    \"readingId\": \"bakery_advanced_recursion_read\"\n  },\n  \"questions\": {\n    \"DefineTreeVocabulary\": {\n      \"type\": \"matching_question\",\n      \"points\": 2,\n      \"body\": \"Match each term to the best definition.\",\n      \"answers\": [\n        \"node\",\n        \"edge\",\n        \"root\",\n        \"leaf\",\n        \"parent\",\n        \"child\",\n        \"tree\"\n      ],\n      \"statements\": [\n        \"The top node in a tree, without any parents.\",\n        \"A bottom node in a tree, without any children.\",\n        \"A given element in a tree.\",\n        \"The connection between elements in a tree.\",\n        \"A data structure holding elements with parent and child relationships.\",\n        \"A node that has one or more nodes under it.\",\n        \"A node that is subordinate to another node.\"\n      ]\n    },\n    \"DefineRecursionVocabulary\": {\n      \"type\": \"matching_question\",\n      \"points\": 2,\n      \"body\": \"Match each term from the reading to the best explanation.\",\n      \"answers\": [\n        \"base case\",\n        \"recursive case\",\n        \"simplification\",\n        \"branch\",\n        \"combination\",\n        \"recursive call\",\n        \"dataclass\",\n        \"Accumulate pattern\",\n        \"modulo\"\n      ],\n      \"statements\": [\n        \"When the function being defined is used in its own definition.\",\n        \"A logical decision in the code to do different things based on a condition.\",\n        \"To bring together the results of the recursive calls and the current element.\",\n        \"The process of reducing down the original argument before the recursive call.\",\n        \"The simpler branch of a recursive function, where the recursion terminates with a simple value.\",\n        \"The other branch of a recursive function, where the recursive call and combination happens.\"\n      ]\n    },\n    \"RecallRecursionLoopEquivalency\": {\n      \"type\": \"true_false_question\",\n      \"points\": 1,\n      \"body\": \"Anything you can do with recursion, you can do with a `while` loop (and vice versa), since they are both looping constructs.\"\n    },\n    \"DetermineRecursiveExpressionTypes\": {\n      \"type\": \"matching_question\",\n      \"points\": 3,\n      \"body\": \"Given the following code, determine the *most accurate* type for each expression on its line.\\n```python\\nfrom dataclasses import dataclass\\n\\n@dataclass\\nclass Tree:\\n    pass\\n\\n@dataclass\\nclass BinaryTree(Tree):\\n    value: int\\n    left: Tree\\n    right: Tree\\n\\nEMPTY = Tree()\\n\\ndef sum_tree(tree: Tree) -> int:\\n    if tree == EMPTY:\\n        return 0\\n    left_side = sum_tree(tree.left)\\n    right_side = sum_tree(tree.right)\\n    result = tree.value + left_side + right_side\\n    return result\\n```\",\n      \"retainOrder\": true,\n      \"answers\": [\n        \"int\",\n        \"float\",\n        \"bool\",\n        \"str\",\n        \"list[int]\",\n        \"list[float]\",\n        \"list[str]\",\n        \"list[bool]\",\n        \"Tree\",\n        \"BinaryTree\",\n        \"No way of knowing anything about the type\"\n      ],\n      \"statements\": [\n        \"<code>tree</code> in the branch's condition\",\n        \"<code>tree</code> inside the base case\",\n        \"<code>tree</code> inside the recursive case\",\n        \"<code>tree.left</code> inside the recursive case\",\n        \"<code>left_side</code>\",\n        \"<code>tree.value</code> inside the recursive case\",\n        \"<code>result</code>\"\n      ]\n    }\n  }\n}","ip_ranges":"","name":"11B1) Recursion and Trees","on_change":"","on_eval":"","on_run":"","owner_id":1,"owner_id__email":"acbart@udel.edu","points":1,"public":true,"reviewed":false,"sample_submissions":[],"settings":"","starting_code":"","subordinate":false,"tags":[],"type":"quiz","url":"bakery_advanced_recursion_quiz","version":2},"ip":"216.73.216.157","submission":{"_schema_version":3,"assignment_id":1164,"assignment_version":2,"attempts":0,"code":"","correct":false,"course_id":37,"date_created":"2026-05-20T12:41:58.286766+00:00","date_due":"","date_graded":"","date_locked":"","date_modified":"2026-05-20T12:41:58.286766+00:00","date_started":"","date_submitted":"","endpoint":"","extra_files":"","feedback":"","grading_status":"NotReady","id":2036754,"score":0.0,"submission_status":"Started","time_limit":"","url":"submission_url-7fb5ba7f-693b-425f-a206-a81ba842b2bc","user_id":2044660,"user_id__email":"","version":0},"success":true}
