Answered step by step
Verified Expert Solution
Link Copied!

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 2. a. Describe the concept of a Binary heap and the heap order property. [10 marks] b. Explain the use of the 3. Create a class to implement a queue using a circular array[20 marks] a. The class should contain functions 4. a. Use Prim's algorithm starting at node A to compute the Minimum Spanning Tree (MST) of the following

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Discrete and Combinatorial Mathematics An Applied Introduction

Authors: Ralph P. Grimaldi

5th edition

201726343, 978-0201726343

More Books

Students also viewed these Computer Network questions

Question

1. What are the three major types of discounts?

Answered: 1 week ago

Question

=+ Describe the components. Which month was left out? Why?

Answered: 1 week ago

Question

What is Goodwill and how different is it from other assets

Answered: 1 week ago