TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Data Structures using C++

101 pointsby michaelrbockalmost 12 years ago

14 comments

dljsjralmost 12 years ago
My CS degree was 100% C based; Java shows up in a class about OOP, and our class on Programming Language theory exposes us to Lisp, Java, and Prolog. They used to be Java based and chose to switch back to a C based curriculum around 2007, as well as focusing more heavily on algorithms and data structures while pushing the more &quot;software engineering&quot; type courses in to elective and offering Software Engineering as a specialization on a CS degree.<p>Joel Spolsky wrote a great article[1] in 2005 that basically says using a massively high level language like Python or Java as the core of a CS curriculum is damaging because the languages aren&#x27;t &quot;hard&quot; enough. As curmudgeonly as it might sound, I&#x27;d be inclined to agree. Even though I rarely write C code anymore (we do everything in Java in our lab), the underlying understanding of memory management that is acquired from having to learn to handle it manually has been invaluable to me as a programmer.<p>Additionally, C&#x2F;C++ is the language of UNIX and still the lingua franca of high-performance. Most high-level languages worth their salt will have a foreign interface to dynamically load C libraries; we&#x27;re in robotics and have to work heavily with ROS&#x2F;Gazebo as participants in the DARPA Robotics Challenge, and even outside of this a lot of really great tools for mathematical optimization and high-performance numerical analysis are all written in C. I&#x27;m one of only two or three people in our lab with the requisite knowledge to be able to effectively hand-roll JNI wrappers, and I don&#x27;t consider this to be a good thing at all.<p>It&#x27;s pretty clear to me that C&#x2F;C++ aren&#x27;t going anywhere any time soon, and it&#x27;s always good to see a CS curriculum that still focuses on C&#x2F;C++.<p>1: <a href="http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html" rel="nofollow">http:&#x2F;&#x2F;www.joelonsoftware.com&#x2F;articles&#x2F;ThePerilsofJavaSchool...</a>
评论 #6123735 未加载
评论 #6123699 未加载
评论 #6123666 未加载
评论 #6124305 未加载
Peakeralmost 12 years ago
Most C++ implementations of linked lists are bad, including std::list and apparently, this course&#x27;s.<p>People misunderstand linked lists so badly, that they actually list the motivation for linked lists as fine-grained growth, as opposed to an array-based list.<p>The main benefits of linked lists over array-lists are:<p>* Can put data structures in lists even if they are already in some other data structure. For example, have some ordering between array elements.<p>* In intrusive style (can find the list links based on the item), can add after that position in O(1).<p>* In intrusive style with doubly-linked list, can also delete an item in that position in O(1).<p>Non-intrusive lists are incompatible with having the same O() while also allowing an item to be in multiple data structures simultaneously.<p>std::list indeed does not allow this, and is almost useless.<p>It&#x27;s sad to see this taught incorrectly in courses, too, perpetuating the uselessness of std::list.
评论 #6124475 未加载
评论 #6124461 未加载
评论 #6125104 未加载
16salmost 12 years ago
Understanding the C++ std containers is almost a complete lesson in data structures. std::set is typically a red black tree, std::unordered_set is a hash table, etc. Looking at how these containers are implemented and understanding how&#x2F;when to use which really separates the men from the boys when it comes to scaling and efficiency.<p>You can probably learn the concepts from other languages, but it&#x27;s been my experience that C++ devs typically understand these concepts more so than most.
appplemacalmost 12 years ago
Uhh that yellow<p>&#x2F;&#x2F;<p>Actually, I&#x27;m glad that C++ has been my first programming language. Its syntax is pretty straightforward, and it&#x27;s even better to work with when you&#x27;ve got extremely clear guidelines set up – at my university (UPC BarcelonaTech) we had a course PRO1, where you got seriously punished if you used spaces instead of tabs, or if you set 2 as your tabstop, or if you used goto, to name a few. Now I cannot say that I share all those guideline rules, but at least I understand what a good C++ code style is.
deadfallalmost 12 years ago
Similar:<p>Stanford - Abstractions and data structures C++<p><a href="http://see.stanford.edu/see/lecturelist.aspx?coll=11f4f422-5670-4b4c-889c-008262e09e4e" rel="nofollow">http:&#x2F;&#x2F;see.stanford.edu&#x2F;see&#x2F;lecturelist.aspx?coll=11f4f422-5...</a><p>Edit:<p>The only thing that takes a little research is tracking down the C++ libraries that coincide with the class.
评论 #6124114 未加载
评论 #6124295 未加载
minimaxalmost 12 years ago
I think I&#x27;m in the minority, but I&#x27;m happy to see C++ in a college course. I thought it was all Python and Java these days.
评论 #6123477 未加载
评论 #6123491 未加载
davvidalmost 12 years ago
Michael Crowley&#x27;s a great professor and a swell dude. His Operating Systems class is also a great crash course that forces you into C programming competence.
capkutayalmost 12 years ago
I don&#x27;t know what the fuss is about with java and python.<p>It was really beneficial in school to work on large java projects where we were exposed to eclipse, svn, log4j, junit, jdbc, etc. It was unbelievably useful going into my job. On the other hand, we used C when we were studying something low-level like thread communication or operating systems. C&#x2F;C++ absolutely has its place in the college cs curriculum as do java and python.
1O0101ll100Oalmost 12 years ago
My school teaches an intro course in python and then switches to c++ for the data structures and beyond.<p>It&#x27;s gotta be easier to just start with c++ and run with it.
评论 #6123543 未加载
krappalmost 12 years ago
I&#x27;m taking C++ (almost through with the beginning semester) after basically being self-taught in python, js and php. It&#x27;s interesting, and I can definitely appreciate how it teaches you fundamentals in a way higher languages don&#x27;t necessarily. Sort of like learning to drive stick when all you&#x27;ve known is an automatic.
mhaymoalmost 12 years ago
This seems incomplete without the labs and assignments included. The github link on the assignments page leads nowhere.
zenbowmanalmost 12 years ago
I was a teaching assistant for that class for 2 years, HNs got me feeling nostalgic.
shreeshgaalmost 12 years ago
I once tried to code an assignment involving TF-IDF on a corpus of docs. It ran blazingly fast compared to python. But was debugging segmentation faults until the last minute.
jmt7lesalmost 12 years ago
Learning C++ was the best. That course is just missing the Algorithm Analysis which mine had along with Data Structures, all C++ and no #includes allowed.