Memory Diagram Extra Credit


How It Works

This extra credit will only apply to your quiz if you score below a 60. You can earn up to 5 extra credit percentage points for the quiz!

I also highly recommend this assignment if you are struggling with memory diagrams in general!

Assignment Description

The point of this assignment is to help you come up with a general strategy for making a memory diagram. You are going to type up a generalized step-by-step guide for making a memory diagram of a block of code.

You can upload this as either a .pdf or type the text directly into the text box on gradescope!

Guidelines

  • Try and use an “if…then…” format. E.g. “If I see a function definition, I do this…”
  • Break it into two parts: how to handle things in globals, and how to handle function calls. There will be some repetitive aspects (e.g. how you handle a new variable in globals vs how you handle it in a function call frame is sometimes similar)

Some questions your guide should address:

  • How do I handle the instantiation of a str, int, bool, or float?
  • How do I handle the instantiation of list?
  • How do I handle updating/reassigning variable values?
  • How do I handle function definitions?
  • How do I handle function calls?
  • Within functions, how do I handle variables that are on the heap? (In other words, what if an argument to my function call is a list. How do I show that in the diagram?)
  • What do I do if I see a print statment?
  • What do I do if I see a return statement?
  • What if my return value is something on the heap?

Submission

You can submit on Gradescope!

Contributor(s): Alyssa Lytle