order-statistic-tree-0.1.0.0: Order statistic trees based on weight-balanced trees

Safe HaskellSafe
LanguageHaskell2010

Data.OSTree.Internal

Synopsis

Documentation

size :: OSTree a -> Size Source

Returns size of the tree

bin :: a -> OSTree a -> OSTree a -> OSTree a Source

balanced :: OSTree a -> Bool Source

balanceL :: a -> OSTree a -> OSTree a -> OSTree a Source

balanceR :: a -> OSTree a -> OSTree a -> OSTree a Source

rotateL :: a -> OSTree a -> OSTree a -> OSTree a Source

singleL :: a -> OSTree a -> OSTree a -> OSTree a Source

doubleL :: a -> OSTree a -> OSTree a -> OSTree a Source

rotateR :: a -> OSTree a -> OSTree a -> OSTree a Source

singleR :: a -> OSTree a -> OSTree a -> OSTree a Source

doubleR :: a -> OSTree a -> OSTree a -> OSTree a Source

isBalanced :: OSTree a -> OSTree a -> Bool Source

isSingle :: OSTree a -> OSTree a -> Bool Source

deleteFindMin :: OSTree a -> (a, OSTree a) Source

O(log n). Delete and find the minimal element.

deleteFindMin (fromList [(5,"a"), (3,"b"), (10,"c")]) == ((3,"b"), fromList[(5,"a"), (10,"c")])
deleteFindMin                                            Error: can not return the minimal element of an empty map

deleteFindMax :: OSTree a -> (a, OSTree a) Source

O(log n). Delete and find the maximal element.

deleteFindMax (fromList [(5,"a"), (3,"b"), (10,"c")]) == ((10,"c"), fromList [(3,"b"), (5,"a")])
deleteFindMax empty                                      Error: can not return the maximal element of an empty map

glue :: OSTree a -> OSTree a -> OSTree a Source

balance :: a -> OSTree a -> OSTree a -> OSTree a Source