digitalmars.D.learn - Wanted! Tree Node implementation.
- =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= (22/22) Oct 07 2020 Wanted! Tree Node implementation.
- Jan =?UTF-8?B?SMO2bmln?= (4/26) Oct 12 2020 You can peak into the stdlibrary, how they do it:
Wanted! Tree Node implementation.
Like a:
mixin template TreeNode( T )
{
T parent;
T firstChild;
T lastChild;
T prevSibling;
T nextSibling;
// ForwardRange implementation
property T front() { ... }
property bool empty() { ... }
void popFront() { ... }
// BackwardRange implementation
property T back() { ... }
void popBack();
// RandomAccessRange implementation
T opIndex( ... ) { ... }
// length implementation
property size_t length() { ... }
}
It would be nice to get a link or package or source...
Oct 07 2020
On Wednesday, 7 October 2020 at 14:31:20 UTC, Виталий Фадеев
wrote:
Wanted! Tree Node implementation.
Like a:
mixin template TreeNode( T )
{
T parent;
T firstChild;
T lastChild;
T prevSibling;
T nextSibling;
// ForwardRange implementation
property T front() { ... }
property bool empty() { ... }
void popFront() { ... }
// BackwardRange implementation
property T back() { ... }
void popBack();
// RandomAccessRange implementation
T opIndex( ... ) { ... }
// length implementation
property size_t length() { ... }
}
It would be nice to get a link or package or source...
You can peak into the stdlibrary, how they do it:
https://github.com/dlang/phobos/blob/master/std/container/rbtree.d
Oct 12 2020








Jan =?UTF-8?B?SMO2bmln?= <hrominium gmail.com>