tags:

views:

219

answers:

8

Hey guys,

I need to read "A Practical Introduction to Data Structures and Algorithm Analysis" by Shaffer for class but the code examples in the book are all in C++ which I do not know. I know C and Java already and was wondering if you knew any resources that helped learn enough C++ to understand these examples fast if you already know another language. Thanks!

+2  A: 

I'm not familiar with the book, but any good Algorithms and Data Structure book should be understandable to anyone with programming experience, weather they understand the language the examples are in or not.

Especially, in your case where you already know Java and C, I can't see that you will have any problems following the algorithms just because they are written in C++

hhafez
+2  A: 

This is quite a textbook (and quite expensive, so see if your library has it), but I would recommend the man's book itself, the C++ Programming Language linky. I used it to enhance, rather than create, my understanding of C++, but I used it in the form of a dictionary, and it seemed to work out well. It is written for people comfortable with programming, and you've gotten the pointers AND the OO stuff down, so it may mesh well.

For example... Chapter 2, a Tour of C++ (as I have it open in my lap now), talks about a large number of things, many of which compare themselves to the "C" way of doing things. The things are not new to a Java programmer, but different syntax, etc. Basically, if you want to learn about C++ iterators, look up the iterators chapter, etc.

I think you'll do ok without necessarily needing a book, but C++ has ridiculously tricky syntax, (try figuring out how to assign a constant field in an object instance using the constructor, for example) and I found the book to be quite illuminating. Thankfully, there's a pretty nifty index including operators, which is quite helpful.

Lastly, if you want to be a guru (which I certainly am not), there are discussions about everything from "Exception-Safe implementation techniques" (Appendix E.3) to philosophy of developing large software projects.

So I've given you quite the advertisement (I've never met the guy, honest), but I've found the book to be quite useful.

Agor
+4  A: 

Yes, (the first edition of) Thinking in C++ taught me how to read C++ syntax; it was designed for C programmers and each chapter built incrementally onto my existing knowledge of C, which I found helpful (and it's now available in print or as a download). Many people recommend it.

ChrisW
+2  A: 
brianegge
+1  A: 

I found 'C++' by Till Jeske, 2002, ISBN 0-201-75879-2 very good. It is not a pet killer, only 1.25 thick, and quite well written - concise and to the point. I knew some C++ before but Jeske's book really helped me.

Eric M
1.25 [of what]?
Novelocrat
It is about 1.25 cm thick.
Eric M
+2  A: 

I'm surprised no one has yet mentioned Accelerated C++. It's not based as much on your existing knowledge of C (or Java), but it will teach you the language as it stands alone.

Novelocrat
+2  A: 

Another free textbook is The C++ Annotations by Frank B. Brokken. You can browse it online, or you can download the pdf version.

A quote from the first page:

This document is intended for knowledgeable users of C (or any other language using a C-like grammar, like Perl or Java) who would like to know more about, or make the transition to, C++. This document is the main textbook for Frank's C++ programming courses, which are yearly organized at the University of Groningen

What I like about "The C++ Annotations" is that is being kept uptodate, version 8.0.0 has added C++0x chapters.

Cristian Adam