Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1bda4fd

Browse files
committed
added: AVL tree
1 parent 4ac335f commit 1bda4fd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎Playground.lhs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ f 1 = Cons 1 Nil
3131
'f 0' binds 'List a Z' to the type of 'f'
3232
The compiler will shout at us because expected 'List a Z' will not match the impossible 'List a (S Z)'
3333

34+
AVL Tree
35+
36+
>data AVL a n where
37+
> Empty :: AVL a Z
38+
> Node :: AVL a b -> AVL a b -> AVL a (S b)
39+
> LNode :: AVL a (S b) -> AVL a b -> AVL a (S (S b))
40+
> RNode :: AVL a b -> AVL a (S b) -> AVL a (S (S b))
41+
3442
Existential Quantification
3543

3644
Useless

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /