Last change
on this file since 20624 was
20624,
checked in by svnwiki, 11 years ago

Anonymous wiki edit for IP [86.141.186.14]:

File size:
1.2 KB

Line  

1  == Disjoint Set 

2  

3  An implementation of a [[http://en.wikipedia.org/wiki/Disjointset_data_structuredisjoint set]] data structure. 

4  

5  A disjoint set is a data structure to hold sets of items, providing efficient procedures for finding a representative of the set any item is contained in, and also for joining two sets together. 

6  

7  The user must provide a hash procedure and equality check procedure for the items to be stored in the data structure. 

8  

9  === Procedures 

10  

11  <procedure>(makedisjointset hashfunction equalitytest)</procedure> 

12  Returns a reference to a disjointset object. 

13  

14  <procedure>(disjointset:make disjointset item)</procedure> 

15  Converts the given item into a disjoint set item, and adds it to the disjoint set. There is no usable output. 

16  

17  <procedure>(disjointset:find disjointset item)</procedure> 

18  Returns a reference to the representative item of the set that the given item appears in. 

19  

20  <procedure>(disjointset:union disjointset item1 item2)</procedure> 

21  Modifies the disjoint set, merging the sets represented by the given items. There is no usable output. 

22  

23  === Author 

24  

25  [[http://wiki.callcc.org/users/peterlanePeter Lane]]. 

26  

27  === License 

28  

29  GPL version 3.0. 

30  

31  === Requirements 

32  

33  Needs srfi69 

34  

35  === Version History 

36  

37  * 1.0: initial release 

Note: See
TracBrowser
for help on using the repository browser.