File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Teachers' Lounge and the fly likes Data structure text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Books » Teachers' Lounge
Bookmark "Data structure text" Watch "Data structure text" New topic
Author

Data structure text

Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
Can anyone suggest some good texts for data structures course (taught in Java)? Thanks.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

The several volumes of Bob Sedgewick's "Algorithms in Java" are excellent.


[Jess in Action][AskingGoodQuestions]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Data Structures and Algorithms in Java


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
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

Joined: Aug 16, 2000
Posts: 235
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.
Howard Kushner
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 361
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:


Howard Kushner<br />IBM Certified Enterprise Developer - WebSphere Studio Application Developer V5.0<br />IBM Certified Advanced System Administrator - WebSphere Application Server V5.0<br />IBM Certified Solution Developer - Web Services with WebSphere Studio V5.1<br /><a href="http://www.amazon.com/exec/obidos/tg/detail/-/1931182108/" target="_blank" rel="nofollow">Developing J2EE Applications with WebSphere Studio</a> my Certification Study Guide for IBM Test 287
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
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 ?


  • Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
    Howard Kushner
    author
    Ranch Hand

    Joined: Sep 19, 2003
    Posts: 361
    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

    Joined: Jan 07, 1999
    Posts: 6920
    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
    Ranch Hand

    Joined: May 05, 2000
    Posts: 13974
    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?
    Leslie Chaim
    Ranch Hand

    Joined: May 22, 2002
    Posts: 336
    Should we stop teaching assembly language?


    Normal is in the eye of the beholder
    Thomas Paul
    mister krabs
    Ranch Hand

    Joined: May 05, 2000
    Posts: 13974
    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.
    Kathy Sierra
    Cowgirl and Author
    Ranch Hand

    Joined: Oct 10, 2002
    Posts: 1572
    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."
    Steve Fahlbusch
    Bartender

    Joined: Sep 18, 2000
    Posts: 582
        
        7

    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
    Ranch Hand

    Joined: May 05, 2000
    Posts: 13974
    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

    Joined: May 22, 2002
    Posts: 336
    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)
    David Weitzman
    Ranch Hand

    Joined: Jul 27, 2001
    Posts: 1365
    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
    Ranch Hand

    Joined: Sep 19, 2003
    Posts: 361
    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
    Ranch Hand

    Joined: Sep 19, 2003
    Posts: 361
    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

    Joined: Jan 07, 1999
    Posts: 6920
    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?
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Data structure text