[erlang-questions] strange behaviour of gb_trees

Nico Meyer nico.meyer@REDACTED
Sat May 28 00:39:46 CEST 2011


On Thu, 26 May 2011 22:15:12 +0300 Mikhail Sobolev
<mikhail.sobolev@REDACTED> wrote:
> Hi,
> 
> I played with gb_trees and hit a strange thing: a value that is part
> of the tree can't be found[1].
> 
> Can somebody please point out what I'm doing wrong?
> 
> --
> Misha
> 
> [1]  https://gist.github.com/993823
> 
> 

At first glance I would say the argument you provide to
gb_trees:from_orddict/1 is not an orddict. And orddict is an ordered
list of tuples of size two. Your list is not ordered.

Try instead
1> T = gb_trees:from_orddict( lists:sort(P) ).

Cheers,
Nico




More information about the erlang-questions mailing list