Bst

Hey Duy! I'll happily take a look at it =)

Would you mind signing onto the IRC so I can ask you a few questions?


On Wed, Jul 16, 2014 at 3:57 PM, Duy Tran <notifications@github.com> wrote:

> In BST/bst.py:
>
> > +    def _find_node(self, val):
> > +        tmp = self._root
> > +        tmp_parent = None
> > +        while True:
> > +            if val < tmp._data:
> > +                tmp_parent = tmp
> > +                tmp = tmp._left
> > +            elif val > tmp._data:
> > +                tmp_parent = tmp
> > +                tmp = tmp._right
> > +            else:
> > +                return tmp, tmp_parent
> > +            if tmp is None:
> > +                raise IndexError
> > +
> > +    def delete_node(self, val):
>
> -.- dammet sent to wrong person, sorry Corinne
> … <#14741658a2a21c40_>
> On Wed, Jul 16, 2014 at 3:56 PM, Duy Tran <drytuna@gmail.com> wrote: >
> would you like to take a look at our updated version using dictionary as >
> the placeholder =) ??? > >
> https://github.com/corinnelhh/data-structures/blob/debug/BST/duy_bst.py >
> > > On Wed, Jul 16, 2014 at 3:33 PM, Naomi T. S. <notifications@github.com>
> > wrote: > In BST/bst.py: > > > + def _find_node(self, val): > > + tmp =
> self._root > > + tmp_parent = None > > + while True: > > + if val <
> tmp._data: > > + tmp_parent = tmp > > + tmp = tmp._left > > + elif val >
> tmp._data: > > + tmp_parent = tmp > > + tmp = tmp._right > > + else: > > +
> return tmp, tmp_parent > > + if tmp is None: > > + raise IndexError > > + >
> > + def delete_node(self, val): > > This method is just a tad too complex,
> and also should be called delete(), > > — > Reply to this email directly or
> view it on GitHub > <
> https://github.com/corinnelhh/data-structures/pull/21/files#r15032294>. >
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/corinnelhh/data-structures/pull/21/files#r15033166>.
>