Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a collection of data structures, e.g. balanced trees?

0
10 Posted

Is there a collection of data structures, e.g. balanced trees?

0

Linked lists are a fundamental part of Erlang, as are tuples. The other standard data structures are: Table 1. Standard data structures ModuleDescriptionsetssets, i.e. a collection of unique elements. gb_setssets, but based on a general balanced data structure gb_treea general balanced tree dictmaps, also called associative arrays etshash tables and ordered sets (trees) detson-disk hash tables The contributions area at the erlang.org site includes modules for double-ended queues and balanced trees. ordset and orddict are not really suitable for large amounts of data: they are no better that lists for many common operations, e.g. inserting an element is O(n) for both. dict and sets are usually preferred. In practice, Erlang programs use lists (either natively or via dict) for data structures involving up to a few hundred elements and use ETS (the Erlang Term Store) or mnesia for anything larger. ETS uses hashing to allow near constant-time access to almost arbitrarily large amounts of d

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.