Skip to main content

All Questions

4 votes
1 answer
1k views

Iterative Red-Black Tree (dynamic stack)

I've completely reworked the previous code, posted here, so that it is a bit more correct regarding dynamic memory management, and also a bit more true to the object-oriented paradigm. ...
Stefan Stanković's user avatar
4 votes
2 answers
2k views

Memory management for Red-Black Tree

I've written this program yesterday, and I was reminded why I dreaded C++ before turning to Java: pointers and associated terms (like destructors, initializations and copy/move constructors) are ...
Stefan Stanković's user avatar
6 votes
1 answer
561 views

Specialty tree structure - BK Tree

I've been working on a implementation of specialty tree structure called a BK-Tree (more here and here). Basically, it's a tree that allows relatively efficient querying for items within a specific ...
Fake Name's user avatar
  • 201
14 votes
2 answers
2k views

Free a binary tree without using recursion or allocating memory

As the title says, the objective is to free a binary tree without using the stack or allocating memory. This was required for a kernel module where resources were limited. Result has a complexity of \...
Loki Astari's user avatar
  • 95.4k
0 votes
1 answer
4k views

Breadth-first tree traversal using STL list

I am writing code for breadth-first search of a tree with C++'s STL. Please help as I am new to the STL. ...
Ankur Singh's user avatar
3 votes
2 answers
3k views

Tree Node class - deallocation in the destructor

Is my destructor correct? Does it properly deallocate the subtrees? ...
Worryn Ashtrod's user avatar