Question: 1. a. Using C++, represent the following graph using adjacency matrix, and implement depth first searching (DFS) by stack (define it with class) to traverse

 1. a. Using C++, represent the following graph using adjacency matrix,

1. a. Using C++, represent the following graph using adjacency matrix, and implement depth first searching (DFS) by stack (define it with class) to traverse the graph. 6 7 2 4 b. If starting with node 2, when node 7 is printed, what numbers are in the stack (for DFS)? Please draw the stack step by step to show how the numbers are pushed into and popped out of it. 2. a. Given a set of integer numbers as int Al1-(12, 8, 51, 0, 3, 7, 19, 6, 4, 21), please write down the divide and conquer procedure of quick sort (step by step), include all left and right positions adjustment, and overwriting. b. Using C/C++, define two integer arrays; each has 30 integers within [o, 99]. Use loop and rand0 to assign random integers to the arrays; then implement Selection and Insertion and Quick sort algorithms to sort the two arrays in ascending order respectively (i.e. using selection to sort the 1st, and quick to sort the 2nd). For each array, print all array elements after sorting to verifty the results c. based on 2.b and the sorted array, define a function of the Binary Search algorithm, then input a number in main) and call the binary search function to search a number in the sorted array and output the result (Note, search in one of the two sorted arrays will be enough) The following specifications will be expected for each programming proiet in this lass

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!