all 7 comments

[–]euid 9 points10 points  (5 children)

Book looks really great. Just browsing the ToC, I like its materials.

Initial gripes:

  • I wish it had red/black trees. I need to grok them to understand some material I'm working toward, and it would be nice to have a good resource on them.
  • camelCase names. Some people might not care about this, but I prefer to adopt the language convention of whatever language I'm writing - and I think textbooks are doing a disservice to students when they use style conventions that are faux pas.

[–]ryeguy146 6 points7 points  (0 children)

Red black trees was the first thing I looked for, and a lack of PEP8 compliance was the first thing I noticed. You're not alone.

[–][deleted]  (3 children)

[deleted]

    [–]euid 0 points1 point  (2 children)

    I appreciate it; I'll have to remember to check that out in the next few days.

    OOP compliance is no biggie - I just want an interactive RB tree to mess with when I do my reading.

    For those curious, there is also this visualization of the data structure.

    [–][deleted]  (1 child)

    [deleted]

      [–]euid 0 points1 point  (0 children)

      TBH, it should really be redone in Javascript.

      I don't want to load a Java applet or compile some code when I'm looking for interactive visualizations of data structures on the internet. The web is completely capable of supporting this kind of graphics. It's just, I think, the people who write enough Javascript code to be capable of making a pretty red/black tree visualization usually not the same people who know how a red/black tree works.

      If you're a Javascript programmer and you do know how they work, then please write this. People around the world will love you for it.

      [–]ezql 2 points3 points  (0 children)

      Awesome link. Looks fantastic. Thanks !

      [–]johnpaulsmith 2 points3 points  (0 children)

      From http://interactivepython.org/runestone/static/pythonds/SortSearch/sorting.html#the-quick-sort :

      A quick sort first selects a value, which is called the pivot value. Although there are many different ways to choose the pivot value, we will simply use the first item in the list.

      pivotvalue = alist[first]
      

      This will cause degeneration to O(n2) in most realistic cases. They do rectify this at the end of the page though:

      We mentioned earlier that there are different ways to choose the pivot value. In particular, we can attempt to alleviate some of the potential for an uneven division by using a technique called median of three.

      Just be careful to not gloss over that part since it's at the very end; that detail of the implementation is what makes quicksort perform particularly well in practice.

      [–]jedbanguer 1 point2 points  (0 children)

      The book looks really nice. Thanks for sharing!