For all “short programming assignments,” include source code files in your submission.
1. Short programming assignment. Combine the malloc2D function of program 3.16 with the adjacency matrix code of program 3.18 to write a program that allows the user to first enter the count of vertices, and then enter the graph edges. The program should then output the graph with lines of the form:
There is an edge between 0 and 3.
2. Short programming assignment. Modify your program for question 2.1 so that after the adjacency matrix is created, it is then converted to an adjacency list, and the output is generated from the list.
3. Short programming assignment. Modify program 4.7 from the text, overloading the == operator to work for this ADT using a friend function.
4. Is the ADT given in program 4.7 a first-class ADT? Explain your answer.
5. Suppose you are given the source code for a C++ class, and asked if the class shown is an ADT. On what factors would your decision be based?
6. How does using strings instead of simple types like integers alter the O-notation of operations?