Quiz submission record for quiz2-1-1 at Sun Jun 27 20:29:01 2004: Your Answer for Question 1: a. False. Suppose you start with one big block of free space. If you malloc a small piece of memory, it will be at the beginning of the free block and you still have one free block. b. True. As mentioned above, you can start with 1 big free block, malloc a small piece, and still have 1 chunk of free space. c. False. The algorithm for malloc is the first fit algorithm. If I have a free block of size 10 and memory of size 6 that I want to allocate, that memory of size 6 will be left justified in the free block of size 10 so the number of free blocks will not increase. Your Answer for Question 2: a. False. Suppose I have the following memory configuration where X's represent free space and O's represent used space. OOXXXXXXXXX. If I free the used space, I just get a bigger chunk of free space but I still have one block of free space. b. True. See part a. c. True. XXXOOOXXX has two free blocks. Freeing the used space results in one block. I don't see how it could reduce the number of free blocks by more than one since an occupied space at most borders two free spaces. d. False. See part c. Your Answer for Question 3: Java equivalent to malloc in C: new Java equivalent to free in C: Doesn't exist. Java automatically does garbage collection. There is no automatic memory allocation in C because C is the lamest and most retarded computer language I have ever seen. Real answer: Variants of C may have it but ANSI C doesn't because different machines use different memory layouts so an automatic memory management scheme that works on one system may not work on another. Your Answer for Question 4: Reference Count: No, it doesn't work for circular structures. Mark and Sweep: Yes, mark and sweep uses a graph traversal to mark everything that is still accessable. That looped structure will not be mark and therefore will be deleted because the graph traversal will not reach that structure since it is isolated. Your Answer for Question 5: It's not really difficult, it's just that it's seems like review of some of the concepts from CS 61B but it's in a different language. I don't like to read through all the C code and understand what is going on since I really do know what is going on but reading C code and taking time to understand what all the variables and loops are for is very time consuming. By just glancing over the C code, I may have missed some valuable information. Your unique submission ID is quiz2-1-1-cs61c-ej-1088393341-552.