On 24 April 2018 at 12:59, Louki Sumirniy
<louki.sumirniy.stal...@gmail.com> wrote:
> I'll just be brief this time and hit the points quickly:
>
> Yes, technically it is a Complete Binary Tree but you won't find a Complete
> Implementation of one anywhere, I have looked, and there isn't. The concept
> has been rejected without being tested by anyone who has considered it at
> least what I can find.

Actually, I think it's probably a "full binary tree" you're thinking
of rather than a complete binary tree, although I can't tell until you
implement some of the insert or search operations. FYI a complete
implementation of a complete binary tree can be found in the Go
standard library as part of the heap implementation: see
https://golang.org/pkg/container/heap so it's hard to say the concept
has been rejected by everyone. It's the standard algorithm for a
binary heap.

> Technically my approach is more like a functional programming approach to
> the problem, as I am passing pointers to functions in order to implement the
> data specific elements, only the interface for the array store is OOP style
> (and it DOES have to be encapsulated in a struct because Go slices do not
> work with interfaces).

I'm sorry, there really is nothing functional-programming-like about
your implementation.
Use of function values does not imply a functional programming style.

> As to exposing things, in fact an external payload data type library can
> decide exactly what it will expose. I am only writing a base implementation
> with uint32 because to test it I have to fill the data with *something* and
> quite likely 32 bit hashes will be actually used in my intended application
> for this library, as the heads and tails from 64bit hashes.

If you're using 32 or 64 bit hashes, you really should not assume
you're cannot get zero-valued hashes.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to