1
0

SPECS 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. In this assignment, you need to submit the following files:
  2. README
  3. Makefile
  4. pa09.c (You need to modify pa09.c.)
  5. tree.h
  6. tree.c
  7. helper.h
  8. helper.c
  9. You need to create a zip file that include all of these files.
  10. (Remember README)
  11. This assignment has the following purposes:
  12. * learn how to use binary search trees: insert, search, delete, and
  13. destroy
  14. * learn how to write the main function
  15. * learn how to write Makefile
  16. Your program needs to have the following functions:
  17. * Read commands and integers from a file. You do not know the length
  18. of the file and you must NOT scan the file to count the number of
  19. lines. Instead, the program must allocate memory as more data is
  20. read.
  21. * Your program cannot use fseek or rewind in this program. Your program
  22. can read the input file only once.
  23. * The program stores the integers in a binary search tree.
  24. * Delete some integers in the binary search tree. The tree must
  25. maintain the properties of a binary search tree, i.e., no
  26. duplicates, all values in the left substree are smaller than the
  27. root, all values in the right substree are smaller than the root,
  28. recursively.
  29. * It is possible that the input file may contain duplicate integers.
  30. *************
  31. * IMPORTANT *
  32. *************
  33. If your program leaks memory (reported by valgrind), you will lose
  34. 1% for every leaked byte.
  35. NOTE:
  36. Type "make" to compile the source code.
  37. Type "make grade -s" to run the grading script.
  38. Type "make clean" to remove generated files.