You are expected to complete this assignment individually. If you need help, you are invited to come to office hours and/or ask questions on piazza. Clarification questions about the assignments may be asked publicly. Once you have specific bugs related to your code, make the posts private.
This homework has a similar set of problems to what you did in the warmup. These will be used in next week's two-week project.
Problem 1: memory struct and functions
You will implement the second comparison function for memory: memory_size_cmp
Problem 2: binary search tree
You are writing several binary search tree functions (bst) to add to what you implemented in the warm-up:
Problem 3: read memory blocks
You will write a function with the following interface:
bst* read_memory_blocks(char *filename, int (*cmp)(const void* x, const void* y));
This function takes in a filename. It reads in the file and splits the file into memory blocks. Create files hw7.h and hw7.c, and put function read_memory_blocks into these files. Each line in this file corresponds to a block of memory, i.e., an integer of memory address and another integer of memory size, separated by a comma. I suggest using fgets to read in the lines and strtok to divide the line into words.
Note that this function has a lot going on within it - and it will be hard to get partial credit if it doesn't work. Partial credit is from implementing the other functions in the warm-up and hw. However, to get credit for this problem, you need to finish it.
$ svn add *.c *.h Makefile testmemory1.txt testmemory2.txt
$ svn commit -m "hw7 complete"