• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data structure text

 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone suggest some good texts for data structures course (taught in Java)? Thanks.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The several volumes of Bob Sedgewick's "Algorithms in Java" are excellent.
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Data Structures and Algorithms in Java
 
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Who are the students? If they already know Java, a good general book (like Cormen, Leiserson, Rivest) might be a good way to go.
(Disclaimer: Rivest was my thesis advisor and I work with Lesierson from time to time.)
--Mark
 
Simon Xu
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all your replies. The situation is that students have taken 2 introduction courses in java before taking this data structure courses (second year courses). The data structures are taught in two courses. More thought? Thanks.
 
author
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I must be missing the point...
Why do data structures in Java when there are so many cool collection classes? Just to prove that we can? :roll:
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do data structures in Java when there are so many cool collection classes?
  • To give the students enough understanding to sensibly choose between the different data structures and the several provided implementations of each data structure.
  • Becuase some important and widely used data structures are not available in the collection classes. Where is the java.util.Tree interface, for example ?

  •  
    Howard Kushner
    author
    Posts: 361
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Frank Carver:
    Why do data structures in Java when there are so many cool collection classes?

  • To give the students enough understanding to sensibly choose between the different data structures and the several provided implementations of each data structure.
  • Becuase some important and widely used data structures are not available in the collection classes. Where is the java.util.Tree interface, for example ?



  • Interesting... Perhaps I should have been more explicit when I spoke about the collections classes, and made it clear that my point was that the new interfaces were the best part of the deal, and their implementations are just that, implementations. Furthermore, IMHO a Tree seems to be more of an implementation than an interface per se. I believe that the GoF says something like program to the interface, not the implementation.
    I am getting ready to teach a group of students this week, and we will cover collection classes in depth. I always make it a point of showng the difference between the interface and the implementation.
    If I have totally missed you point abut the Tree interface, please accept my apologies. I has been a long week. I truly would appreciate it if you would help me understand. I remember hearing someplace (probably Covey) "seek first to understand, then to be understood". Thanks for taking the time to post.
    Best Regards,
     
    Frank Carver
    Sheriff
    Posts: 7001
    6
    Eclipse IDE Python C++ Debian Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    If I have totally missed you point abut the Tree interface, please accept my apologies.
    No worries. I've been through this several times. See this old thread for example.
    In my mind the abstract concept of a tree, and the operations on it, exist ast the same sematic level as List, Set and Map. I can easily imagine a Tree interface such as:

    You could then easily provide a BinaryTree implementation, a SelfBalancingTree implementation, DOMTree implementation, a JNDITree implementation, a DatabaseBackedTree or whatever. And use any of these objects in things such as the swing tree widget or a tree browser bean in a JSP, or a parser ...
    Much like List, Set and Map, really.
    Does that make sense?
     
    Thomas Paul
    mister krabs
    Posts: 13974
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Howard Kushner:
    I must be missing the point...
    Why do data structures in Java when there are so many cool collection classes? Just to prove that we can? :roll:

    The point is to learn data structures. The fact that this has been implemented already is irrelevant. Should we stop teaching how data is stored in files because we have java.io? Should we stop teaching encrypting algorithms because we have JCE?
     
    Ranch Hand
    Posts: 336
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Should we stop teaching assembly language?
     
    Thomas Paul
    mister krabs
    Posts: 13974
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Leslie Chaim:
    Should we stop teaching assembly language?


    Teaching data structures which is universal across all languages is not the same as learning a specific language. Although I think learning assembly language gives you a much greater understanding of what goes on inside the machine.
     
    Cowgirl and Author
    Posts: 1589
    5
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Howdy -- well, I'm still just rejoining the land of the living so I haven't been here for a while, but all I can add is that data structures (not just "Collections in Java") is the single most-requested "thing not in our book" from teachers.
    Now, this doesn't mean that it is what *learners/readers* ask for, but then, this is an area where students wouldn't necessarily know they needed it unless they're coming from a strong cs background (in which case, they're probably not reading our book anyway).
    In fact, we're going to add that to a teaching supplement, and if we do an advanced programming book, that would be one of the core features. There can still be a lot of debate over how deep to go... but it does seem pretty important.
    Our job will be to come up with how to make that fun... I'm of course counting on you guys to have good ideas about that
    cheers,
    Kathy
    "At the sub-atomic level, I'm really quite busy."
     
    Bartender
    Posts: 612
    7
    Mac OS X Python
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    If indeed you are really teaching data structures (and using java as the implementation tool) rather than java data structures - I suggest the old classic The Art of Computer Programming by Knuth. It is a little difficult to get into, but once the students do the results are very rewarding.
     
    Thomas Paul
    mister krabs
    Posts: 13974
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Kathy Sierra:
    Our job will be to come up with how to make that fun... I'm of course counting on you guys to have good ideas about that

    \
    If you do write a Data Structures and Algorithms book, just realize that you have some powerful competition. Look at the reviews on this book (ignore the spotlight review):
    "You can bubble sort me any time, Mr Schidlowsky"
     
    Leslie Chaim
    Ranch Hand
    Posts: 336
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Thomas Paul:

    Teaching data structures which is universal across all languages is not the same as learning a specific language. Although I think learning assembly language gives you a much greater understanding of what goes on inside the machine.


    Absolutely agree, I was just continuing your prose
    In any case for the simple sake of knowledge �. Well, I'm not going to repeat whatever you had said. (Oops I just did)
     
    Ranch Hand
    Posts: 1365
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Why do data structures in Java when there are so many cool collection classes? Just to prove that we can?
    People have already stated philosophical reasons, but let me offer another reason: the Collections framework is useful for general applications but extremely incomplete when you know precisely what you want. Offhand I believe it covers little more than hashtable, linked list, red-black tree, and merge sort. Those topics combined might fill anywhere from 15 to 30 pages in an algorithms text, but the shortest algorithms text I own has about 900 pages.
     
    Howard Kushner
    author
    Posts: 361
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Frank Carver:
    In my mind the abstract concept of a tree, and the operations on it, exist at the same semantic level as List, Set and Map. I can easily imagine a Tree interface such as:
    <SNIP />
    Much like List, Set and Map, really.


    Okay. I get that, but in my alleged mind all those trees are implementations of List, Set, SortedSet, Map, and SortedMap, which IMHO represent more flexible contracts.
     
    Howard Kushner
    author
    Posts: 361
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    David Weitzman:
    the Collections framework is useful for general applications but extremely incomplete when you know precisely what you want.


    That's the key then: Not confusing the what with the how.
    Therefore, since this is the Java Ranch, and I think of Java(tm) as a general purpose programming language, where the interface is the what, and the implementation is the how...
    I think it would be really cool to do forests full of trees. The sticking point though is whether a Tree is a contract per se, or a possible implementation. And it looks like there may be more than one logical conclusion. That's what diversity is all about, eh?
    Anyway, it's been tons of fun chatting with you guys.
    [ November 19, 2003: Message edited by: Howard Kushner ]
     
    Frank Carver
    Sheriff
    Posts: 7001
    6
    Eclipse IDE Python C++ Debian Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Howard Kushner wrote Okay. I get that, but in my alleged mind all those trees are implementations of List, Set, SortedSet, Map, and SortedMap, which IMHO represent more flexible contracts.
    Sure, but they have no base interface in common, so if you have some processing which needs to operate on a conceptual tree, and swap between those implementations at will you are out of luck. Just like we were before the collections API, trying to build something that behaved like a Hashtable, but with no interface to say so.
    I can't see any obvious problem with a concrete class implementing both List and Tree, say. I just can't help feeling that trees are such a common concept in so many of the Java APIs, and yet so few of them are interoperable. Is browsing or searching JNDI really so different from browsing or searching a DOM that it should never even be possible to reuse client code, for example?
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic