[Haskell-cafe] Re: inserting values in a binary tree
toman144 at student.liu.se
Sat May 10 05:09:22 EDT 2008
Den Saturday 10 May 2008 00.55.44 skrev PR Stanley:
> Actually, you've touched an important point there. It's balancing
> that I'm having difficulty with.
So what kind of balancing rules does it have to obey? AVL? Red-black?
> At 23:46 09/05/2008, you wrote:
> >PR Stanley <prstanley at ntlworld.com> wrote:
> > > Hi
> > > data Ord a => Tree a = Nil | Node (Tree a) a (Tree a)
> > > How would one go about inserting a value in a binary search tree of
> > > the above description?
> >Using a library ;)
> >Inserting isn't the problem, balancing is where things get interesting:
> >have a look at
> >(c) this sig last receiving data processing entity. Inspect headers for
> >past copyright information. All rights reserved. Unauthorised copying,
> >hiring, renting, public performance and/or broadcasting of this
> >signature prohibited.
> >Haskell-Cafe mailing list
> >Haskell-Cafe at haskell.org
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe