Using the graph below, a. Draw an adjacency list and matrix. [5 MARKS EACH] b. Perform...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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] 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]
Expert Answer:
Answer rating: 100% (QA)
Answer ANSWER1 ADJACENCY MATRIX ADJACENCY LIST DFS TRAVERSAL WITH SOURCE C CABEDF DFS TREE EXPLANATI... View the full answer
Related Book For
Discrete and Combinatorial Mathematics An Applied Introduction
ISBN: 978-0201726343
5th edition
Authors: Ralph P. Grimaldi
Posted Date:
Students also viewed these computer network questions
-
1.You want to financed a car that advertised at $31683 but you don't have money. However after checking your credit the dealer offered you that if you pay $583 per month for 5 years, they will give...
-
1. Create an adjacency list and adjacency matrix of the given graph below. 2. Write the adjacency list at the 1st quadrant and the adjacency matrix at the 2nd quadrant. 3. Perform Breadth-First...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
An interest payment of $650 in a 20 percent tax bracket would result in a tax savings of _____.
-
Are leaders born or made, and can leadership skills be developed?
-
The Treed Partnership has total partners equity of $510,000, which is made up of Elm, Capital, $400,000, and Oak, Capital, $110,000. The partners share net income and loss in a ratio of 80% to Elm...
-
Discuss the reasons why almost all colonies had achieved independence by the end of the 1960s.
-
Consider the following four investments. a) You invest $3,000 annually in a mutual fund that earns 10 percent annually, and you reinvest all distributions. How much will you have in the account at...
-
Mark Down Han Golf Emporium sells golf balls for $27.95 per dozen. The emporium's overhead expenses are 49% of cost and Nahee, the owner, requires a profit of 22% of cost. What is the break-even...
-
In this question, you are given a Timed Petri net as shown below. The time stamps of the tokens (i.e., black dots in some places) are also provided on the figure below. The delay on the transition T0...
-
On April 2014, Suri purchased a health insurance policy under the 'Executive VIP Plan' Policy from Joe Fernandez, who represents WeCARE General Insurance Berhad. The first instalment ...
-
How does a defined-benefit plan differ from a defined-contribution plan?
-
When the manager of a bank's portfolio of securities considers alternative investments, she is also concerned about the risk weight assigned to the security. Why?
-
a. What is a cash balance plan? b. Discuss the resemblance of a cash balance plan to a defined-benefit and a defined-contribution plan.
-
a. What is a program trade? b. What are the various types of commission arrangements for executing a program trade and the advantages and disadvantages of each?
-
a. What is an insured pension plan? b. What is the function of PBGC?
-
The volume integral 1= ()x, is over a region V bounded by a surface (an infinitesimal area element being nds, where is the outward unit normal). If it changes to I+Al when the vector A is changed...
-
Highland Theatre is owned by Finnean Ferguson. At June 30, 2014, the ledger showed the following: Cash, $6,000; Land, $100,000; Buildings, $80,000; Equipment, $25,000; Accounts Payable, $5,000;...
-
Let a, b, m, n Z with m, n > 0. Prove that if a = b (mod n) and m , then a = b (mod m).
-
Prove that for all integers n exactly one of n, 2n - 1, and 2n + 1 is divisible by 3.
-
Construct a truth table for each of the following compound statements, where p, q, r denote primitive statements. (a) (p q) p (b) p (q r) (c) (p q) r (d) (p q) (q p) (e) [p (p q)] q (f)...
-
Which forecasting technique is more qualitative, the Delphi method or linear regression?
-
A road-paving crew required 8 hours to repave a 3-mile stretch of road, using \($5,000\) in materials. The crew consisted of three workers who each earn \($25\) an hour. Calculate a multifactor...
-
An automobile assembly plant produced 600 cars during a 5-day workweek. It then produced 500 cars the following week, although it only operated 4 days due to a national holiday. During which week was...
Study smarter with the SolutionInn App