Friday, July 31, 2009

C++ Data Structures and Algorithms - I'm scared?

Well I'm slowly chipping away at a BS in Computer Science and I've kind of put off one of the courses, Data Structures and Algorithms.





I know this is sort of a cheesy question, since the answer depends on many things...but I'm wondering how difficult this class will be. I'm nervous about it because I took the two previous C++ classes over a year ago...so not sure how much I'll remember. I did pretty good in these classes but was starting to struggle a bit toward the end with arrays of classes and whatnot.





I also did fine in the other pre-req for this course, applied discrete math, but we really didn't do any programming in this course.





Description of the course:





Upon completion of this course, you should be capable of discussing and/or applying C++ programming methods in the following areas:





• Analysis of algorithms using Big-O notation


• Complexity analysis


• Linked lists


• Queues


• Stacks


• Recursion


• Trees


• Heaps


• Searching


• Sorting


• Hashing





any thoughts? thanks

C++ Data Structures and Algorithms - I'm scared?
I found Data Structures to be easier than some of the other CS courses I took before it. At this point you should be comfortable with OOP and understand the basics of class design, pointers, etc. What data structures teaches you is how to store information in a way that is best suited to your program (quickest reads, writes, deletions, insertions, etc).





Each one of those structures listed has its own advantages and disadvantages, and you'll learn how to determine which is best for you. As for the implementation of the data structures, take some time to understand how each one works - the actual code isn't too difficult to write.





It wouldnt hurt to brush up on arrays of classes, since you may have to use them to represent the underlying data (depending on your instructor's specifications).





Good luck!
Reply:C++ is always a scary class to take...believe me I took a few myself in my quest for a degree in Electrical Computer Engineering.





I would go back and review any information you had from previous classes and if you feel lost or can't remmeber why you did some things try to load up your projects on a PC and step through them...also, maybe review some tutorials on-line...there are TONS of C++ tutorial sites and I know they will all provide you with similar information regarding the topics of C++ that you have covered (such as arrays, and classes).





Discrete math I think has very little to do with C++...I took 3 calculus classes and a differential equations course and never used anything from these classes when it came to learning the concepts of C++ they might suggest taking this course if you are going to be involved with programming any applications where math is involved and usually programming classes try to stick with more programming related information and would probably not care too much whether you can do discrete math :)





The list of topics to be covered is interesting and I can tell you right now it won't be easy, but its not impossible by any means. Maybe if you do review some online tutorials begin learning about these topics as well so you could get a little jump start and have a better understanding before you even go to the classes. You will probably find yourself following along and understanding a LOT better.





Here are some tutorial sites:


www.cplusplus.com/doc/tutorial/





www.cprogramming.com/tutorial.html





www.glenmccl.com/tutor.htm





www.cs.wustl.edu/~schmidt/C++/





www.intap.net/~drw/cpp/





and you could probably find many many more :)
Reply:Your two previous courses focused on computer programming. C++ is a language. It has a bunch of syntax you learn to use. They also had a mild introduction to computer science. You came across loops, flow control, and your basic large contiguous container (arrays).





Computer science concepts aren't tied down to a language. Loops for example, aren't something specific to C++. Because it is such a fundamental construct, every real (Turing complete) language implements it in some manner. C++ has while and for loops. Python, for example has no direct equivalent to C++'s for loop. But it has a foreach loop, that allows iteration over a sequence. The same computer science concept is expressed differently in Python. But it is the same, language independent concept.





Data structures and algorithms will be your first real computer science course. Yes, C++ may be used. Or maybe another C like language. But you won't be focusing on C++. You'll be focusing on CS concepts. DS%26amp;A also happens to be a fundamental course, and a foundation course. You can simplistically describe an approach to CS problems as: figure out data structures needed, and then the algorithms to operate on those data structures. You cannot proceed without going through DS%26amp;A.





Your past two courses focused on getting C++ syntax right. So none of your problem sets/homework assignments really tested your ability to solve arbitrary problems and to be able to visualize an implementation for it. This is a second turning point for most aspiring computer science students. If you don't like programming itself, well that's that. But you also have to be able to visualize a solution to an arbitrary problem. It won't be, okay here's a problem, let's look up a similar problem in the textbook and reuse the code. You're given a number of concepts (data structures and algorithms), and you need to put them together arbitrarily to solve your problem at hand. For some people, this is straightforward, and for some people, it's pretty much impossible. They get the programming syntax. They understand the concept of a certain structure. They just can't put 2 and 2 together.





That's why, you should take this course early on. You'll know for certain if you like computer science. You'll also have the critical foundation necessary for other CS courses.





Because this is primarily a critical thinking course, try to find either classmates who you know for sure are able to handle the concepts easily and breeze through the course, or work with your TAs and professors.





It would be really bad if your C++ is shaky. Or whatever language is used in DS%26amp;A course. If it's C++, get a good C++ book. C++ Primer (4th Edition) by Lippman is golden. Accelerated C++ by Koenig is another quality book, but it's more like a book you learn from than a reference book. There's other advanced C++ books to have, but you don't really need them for the DS%26amp;A course.
Reply:If you're really serious about pursuing computer science, then this class may be the single most important class you ever take. It's applicable to pretty much everything else you will ever study.





Of course, this means that its topics are covered a million times over in a million different places. There is no shortage of books and websites where you'll find all the help you'll ever need. So don't be intimidated. This course is a classic, believe me, and everyone had to get through it. There are plenty of programmers out there willing to patiently answer any questions the unitiated might have.





My advice...be ready to draw alot of pictures. For me, data structures and sorting/seraching are easiest to understand if I can see them. Also, complexity may involve you needing to visualize the steps of an algorithm.





Get ready to have your mind twisted a bit by recursion. In my opinion, that's the toughest thing to understand if you've never encountered it before.





Don't be afraid, be excited. You make it through this and you can move on to the really interesting stuff and all your preperation will finally start paying off.





C.F.
Reply:good luck, you might want to carry a light load that semester.


No comments:

Post a Comment