#14411: Disjoint Sets --> iter
---------------------------------------+------------------------------------
Reporter: elixyre | Owner: jason, ncohen, rlm
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.10
Component: misc | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Travis Scrimshaw
Authors: Jean-Baptiste Priez | Merged in:
Dependencies: | Stopgaps:
---------------------------------------+------------------------------------
Changes (by slabbe):
* cc: slabqc@… (removed)
* cc: slabbe (added)
Comment:
> (My opinion is when we write ``d.find(2)`` we expect ``[1,2]`` and not
``1`` (that means nothing for user) but I don't want reimplement all so...
what is your opinion about that?)
The data structure is made so that knowing if two elements ``a`` and ``b``
are in the same subset is optimal in time complexity : ``d.find(a) ==
d.find(b)``. Returning the whole subset containing the element ``2`` is
another question and its time complexity is very different (you need to
call ``find`` on every elements...).
Are you sure you need the union-find data structure for your problem?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14411#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.