Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using the graph below, a. Draw an adjacency list and matrix. [5 MARKS EACH] b. Perform a depth first search using Vertex C as
Using the graph below, a. Draw an adjacency list and matrix. [5 MARKS EACH] b. Perform a depth first search using Vertex C as your source draw the resulting depth first search tree [10 2. a. Describe the concept of a Binary heap and the heap order property. [10 marks] b. Explain the use of the binary heap as an effective implementation for a priority queue [10 MARKS] 3. Create a class to implement a queue using a circular array[20 marks] a. The class should contain functions to i. Insert a new value, [5 marks] ii. Delete a value. [5 marks] iii. Change a value equal to X to a value equal to Y. [5 marks] iv. Count all value equal to X in the queue. [5 marks] b. For each function above perform an asymptotic analysis and state the worst case performance of the algorithm[5 marks] 4. a. Use Prim's algorithm starting at node A to compute the Minimum Spanning Tree (MST) of the following graph. In particular, write down the edges of the MST in the order in which Prim's algorithm adds them to the MST. Use the format (nodel; node2) to denote an edge. [8 marks] 10 20 H F b. For the same graph as above, write down the edges of the MST in the order in which Kruskal's algorithm adds them to the MST. [8 marks]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Answer ANSWER1 ADJACENCY MATRIX ADJACENCY LIST DFS TRAVERSAL WITH SOURCE C CABEDF DFS TREE EXPLANATI...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started