Re: RedBlackTree with Array Store

2011-01-15 Thread Steven Schveighoffer
On Fri, 14 Jan 2011 20:57:18 -0500, %u wrote: Didn't look at your code exactly, but from reading this discussion, what you have implemented is basically a memory pool ;) Huh, interesting... I didn't think about it that way, but in a way, that's true. :) I just thought of it as some tree re

Re: RedBlackTree with Array Store

2011-01-14 Thread %u
> Didn't look at your code exactly, but from reading this discussion, what you have implemented is basically a memory pool ;) Huh, interesting... I didn't think about it that way, but in a way, that's true. :) I just thought of it as some tree representation that did not use pointers. > Yes it's

Re: RedBlackTree with Array Store

2011-01-14 Thread Steven Schveighoffer
On Fri, 14 Jan 2011 00:25:17 -0500, %u wrote: Hi, I've noticed that, just as you can have a heap with an array-backed store, you can also have a binary search tree with the same store (although structured differently; see attachment for a bare-bones unsorted binary tree implementation --

Re: RedBlackTree with Array Store

2011-01-14 Thread Steven Wawryk
I see. It's not what I meant when I described the vector map. That has no pointers/indices stored in it. The position in the tree is implied by the index. On 14/01/11 18:21, %u wrote: The "unsorted binary tree" you mention doesn't sound right. Such a container would need to be kept sort

Re: RedBlackTree with Array Store

2011-01-13 Thread %u
> The "unsorted binary tree" you mention doesn't sound right. Such a container would need to be kept sorted. It would, IF it was implemented the same way as a heap. But it's not. Take a look at my implementation if you get the chance; every node has four members in addition to the value, which a

Re: RedBlackTree with Array Store

2011-01-13 Thread Steven Wawryk
I haven't looked at your code, but I came across the idea of a vector map in C++ (based on a std::vector of std::pairs) with some performance advantages over std::map if there aren't a lot of insertions and deletions. The idea is a good one. Whether it's best as a custom store for RedBlackT

RedBlackTree with Array Store

2011-01-13 Thread %u
Hi, I've noticed that, just as you can have a heap with an array-backed store, you can also have a binary search tree with the same store (although structured differently; see attachment for a bare-bones unsorted binary tree implementation -- which I have NOT yet tested, but which I can test if it