Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 8th, 2004, 03:09 PM
harryh23 harryh23 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 11 harryh23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Disjoint set running time

Hi, does anyone know how to do the question of below :

suppose the disjoint set using both the path compression in Find(x) operation and the weight balance in Union(A,B). There are m operations in Disjoint set and all Union operation appear before the Find operation. How to prove such m operations' total running time is O(m).

thanks in advance

Reply With Quote
  #2  
Old November 11th, 2004, 09:53 PM
7th.com 7th.com is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Long Island, New York
Posts: 4 7th.com User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
only using path-compression or both path compression and union by rank?


Quote:
Originally Posted by harryh23
Hi, does anyone know how to do the question of below :

suppose the disjoint set using both the path compression in Find(x) operation and the weight balance in Union(A,B). There are m operations in Disjoint set and all Union operation appear before the Find operation. How to prove such m operations' total running time is O(m).

thanks in advance

Reply With Quote
  #3  
Old November 11th, 2004, 10:29 PM
harryh23 harryh23 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 11 harryh23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yeah, we would prove if using both path compression and union by rank the running time is O(m). how to prove it ?

Anyway, if only using path-compression, i wonder the running time is O(mlogn) from Tarjan's paper -- worst case of running time for set union (not completely the circumstance with this question). u agree ?

Reply With Quote
  #4  
Old November 12th, 2004, 10:59 AM
7th.com 7th.com is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Long Island, New York
Posts: 4 7th.com User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I think you need try to get some cases:

1) base case: [when m = 4]
Call MAKE() 2 times, then UNION() follow by FINDMIN(), that will give u O(1)

and so, do some more case and see do you get O(m), after m operations have been done

Reply With Quote
  #5  
Old November 12th, 2004, 04:17 PM
harryh23 harryh23 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 11 harryh23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Right. Your idea is my first attempt to solve the question, and it could solve the question. But furtherly thinking about, what is the accurate tight-bound (e.g 2n-1 ,where n is the number of the nodes in the D.Set) we would use induction to prove ?
I still thinking about.

So i also try other simple ways to observe the question instead of proof. We are close the answer now ... fun ...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > Disjoint set running time


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT