The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
1. Give the state of the disjoint-sets data structure after the following sequence of operations, starting
Â
from singleton sets {1}, ... , {8}. Use path compression. In case of ties, always make the lower numbered root point to the higher-numbered one.
Â
union(1, 2); union(3, 4); union(5, 6); union(7, 8); union(1, 4); union(6, 7); union(4, 5); find(1)
Â
2.
Show transcribed image text 1. Give the state of the disjoint-sets data structure after the following sequence of operations, starting from singleton sets {1}, ... , {8}. Use path compression. In case of ties, always make the lower numbered root point to the higher-numbered one. union(1, 2); union(3, 4); union(5, 6); union(7, 8); union(1, 4); union(6, 7); union(4, 5); find(1) 2. Suppose we want to find the minimum spanning tree of the following graph. (a) Run Print's algorithm; whenever there is a choice of nodes, always use alphabetic ordering (e.g., start from node A). Draw a table showing the intermediate values of the cost array. (b) Run Kruskal's algorithm on the same graph. Show how the disjoint-sets data structure looks at every intermediate stage (including the structure of the directed trees), assuming path compression is used.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll