Bug 5586 – length property for RedBlackTree

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-02-15T00:23:00Z
Last change time
2015-06-09T05:14:52Z
Assigned to
nobody
Creator
issues.dlang

Comments

Comment #0 by issues.dlang — 2011-02-15T00:23:12Z
For some reason RedBlackTree doesn't have a length property. From what I understand of red black trees, it should be able to easily keep track of its length and have a length property which is O(1). But it doesn't have that right now. Instead, you have to use walkLength, which is O(n). A length property which is O(1) should be added to RedBlackTree.
Comment #1 by bearophile_hugs — 2011-02-15T03:51:46Z
This is a dupe, see point 3 of bug 5451
Comment #2 by schveiguy — 2011-02-16T06:20:45Z
bearophile, you can mark things as duplicates if you find they are duplicates. *** This issue has been marked as a duplicate of issue 5451 ***