This module provides data structure subjected to random choice of elements in uniform probability.
Tree in this module
take, delete, and filter) all return Maybe (Tree a) just in case all the elements are deleted.fromList takes one heading element and tailing list.(similar with Random.uniform or Random.weighted.)member and delete is O(N).delete or filter is called, so when I say "The time complexity is O(log(N))", N denotes the maximal size in the history of the tree so far.Inserts all elements of given list into the tree.
Removes any number of elements which fails to passes the test function given as the first parameter.
Removes any number of elements which is the same as the first parameter from the second parameter.
Random generator that generates one of the elements conteined in Tree given as parameter.
The time complexity is O(log(N)).
Random generator that generates one of the elements conteined in Tree, paired with the rest part of the tree. The time complexity is O(log(N)).
Random generator that replaces one data from the tree and generates a pair consisting of the removed data and resultant tree.
Type that represents binary tree with elements subjected to random picking up in uniform probabilities.