Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1.Figures for below questions. . (a) Suppose we start with the heap and insert 14 into this heap, show what will be the resulting heap.

1.Figures for below questions.

.image text in transcribed

(a) Suppose we start with the heap and insert 14 into this heap, show what will be the resulting heap.

(b) Suppose we start with the heap and do a single ExtractMax operation, show what will be the resulting heap.

(c) Simulate breadth first search on the graph shown in Fig HW2Q1c. You can assume that the starting vertex is 1, and the neighbors of a vertex are examined in increasing numerical order (i.e. if there is a choice between two or more neighbors, we pick the smaller one). You have to show: both the order in which the vertices are visited and the breadth first search tree.

(d) On the same graph, i.e. the graph in Fig HW2Q1c, simulate depth first search . You can assume that the starting vertex is 1, and the neighbors of a vertex are examined in increasing numerical order (i.e. if there is a choice between two or more neighbors, we pick the smaller one). You have to show: both the order in which the vertices are visited and the depth first search tree.

(e) What is the topological order on the graph shown in Fig HW2Q1e, assuming that the starting vertex is 1, and the neighbors of a vertex are examined in increasing numerical order. Please note that I am asking specifically what will be the topological order produced by this algorithm i.e. it is not enough just to show another topological order.

(f) Trace the execution of Kruskals algorithm on the graph shown in Fig HW2Q1f. Show the connected components each time a new edge is added.

Questions are from algorithm analysis &design course

HW 2 Figures 5 Fig HW2Q1c Fig HW2Q1e 3 3 Fig HW2Qif

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions