Ex. 1. Download the following files:
graph.h
graph.cc
main.cc
Makefile
graph1.txt
graph2.txt
They compile with the command "make" and the program can be executed with the command "graph".
You will have to implement the 3 functions that have their body missing at the end of the graph file and make some modifications to main.cc.
a. write this function should write the graph to a file according to the format described in class and in the notes.
b. input this function should ask the user what the number of nodes in the graph is, then initialize the graph with that number of vertices, which will assign the names as uppercase letters in sequence. Don't ask the user for the names but give them a warning about the way the names were assigned. Then it should input edges in the form first name second name. The input should end with anything that is not an uppercase letter.
c. print_bf or print_df. Choose one of these two functions to implement, and let me know in the email which one you've chosen. These functions should implement the breadth-first and depth-first traversal of the tree where the processing of a node is just writing out the name. For the print_bf you'll need a queue class. You can use either the class from homework 3, of the STL class queue (see the textbook for a reference).
d. Modify the menu functions in main.cc by adding the options of writing the graph to a file or to input it from the user.
Turn in: All the files that you modify.