lab3 - CSE 542 Advanced Data Structures and Algorithms Lab...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
- 1 - Recall and follow the General notes from lab 1. In this lab, you will be studying the performance of Kruskal’s algorithm for the minimum spanning tree and the performance of the partition data structure. Detailed instructions: 1. (15 points) In this part, we’ll study the impact of the two optimizations used by the Partition data structure. Modify the data structure by adding a variable called noOpt , which is initialized by a second argument to the constructor. When noOpt =0, the new version should implement both optimizations. When noOpt =1, it should omit the path compression optimization. When noOpt =2, it should omit the link-by-rank optimization. When noOpt =3, it should omit both. Modify the implementation of Kruskal’s algorithm similarly, by adding a noOpt argument and passing it on to the Partition object when it is created. Turn in a copy of the modified source for the Partition data structure. Produce two charts showing the number of find steps performed by Kruskal’s algorithm for all four values of noOpt and for graphs of varying size. You can use the findcount () method of the Partition object to obtain the number of find steps performed during the running of Kruskal’s algorithm. In the first plot, let n grow from 2 8 up to 2 16 and let
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

lab3 - CSE 542 Advanced Data Structures and Algorithms Lab...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online