[Bug 1641] Red Black Tree data structure

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Sun Sep 19 13:04:17 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1641

--- Comment #13 from Gedare <giddyup44 at yahoo.com> 2010-09-19 08:04:16 CDT ---
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > The code only supports an unsigned integer. Would it be possible to support a
> > > string as well ? Maybe the value could be a union and control structure can
> > > have a flag that indicates the union field. I could use a string based tree.
> > Do you mean that you want to have a tree that sorts based on a string rather
> > than an unsigned integer?  This can be done, we would have to replace direct
> > comparisons of the value field with a function call that implements a compare
> > operator, e.g. a default function that uses the < operator, and one with strcmp
> > if the field is a string.
> 
> An operator call would be a nice solution but it does cost an extra call and I
> was not sure of your use case. I was just thinking about explicit tests for an
> int or a string via a union and a bool in the control which test.
Explicit cases would be better, at least for the core code. My use case is for
sorting and searching priorities (deadlines) in the SCORE, so efficiency is a
concern.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list