The following procedure takes a two-level red-black tree and a
STDIO file pointer as input. It then
writes the tree to the file. It knows the following things about the
red-black tree:
|
|
Your job is to write the procedure reader, which takes
as input the pointer to a file created by writer, and
returns the red-black tree stored in that file.
|
|
JRB jrb_insert_int(JRB tree, int key, Jval val); JRB jrb_insert_dbl(JRB tree, double key, Jval val); int fread(void *ptr, int element_size, int num_elements, FILE *fp); int fwrite(void *ptr, int element_size, int num_elements, FILE *fp);