CS 61B

Data Structures and Algorithms

You know that one class every semester that’s just a breeze?  That one class you expect not to have to put too much work into, and reality plays out the same way?  Guess what, 61B is NOT that class.  61B is that class I expected to be 50% of my academic workload, and turned out to be even more.  Nonetheless, 61B has been one of my favorite classes at Berkeley ironically because it proved to be a formidable challenge for me, a non-CS major.  No class in my academic past has demanded so much of me in both the “work hard” and “think smart” departments.  Sure, some classes like CS70 have made me think smarter, and classes like UGBA 10 have made me work harder, but 61B went for both knees.  Through grueling projects that offset my sleep schedule and intense test questions that unintentionally give me a clean shave from the relentless chin-scratching, this class has been one heck of an experience from which I have finally received a glimpse into the mysterious nature of software engineering.  

As a disclaimer, I must mention two things: 

1. I had NOT taken 61A (the recommended prerequisite for 61B)

2. Many of the datastructures taught in class I had previously glossed over in high school, but never to such a depth

The first part of this class should have been the easiest, but I instead found it to be the most challenging.  For the first month and a half, the class was dedicated to learning the basics of Java: the programming language we would be using for the rest of the semester.  Assignments were not supposed to be too tedious, and the exam was not supposed to be difficult.  I, however, struggled to understand the intricacies of Java.  As Java is perhaps the first and only coding language I learned, the process was similar to learning a first verbal language.  I would try to muscle my way through problems or projects with logic, but often I could not find rhyme or reason within Java. I can compare the experience to trying to intuitively infer the grammatical rules of a foreign language. Perhaps such abilities come naturally to others, but certainly not to me.

One of the more advanced datastructure learned in class: the KD Tree

Thankfully, the curriculum started at peak difficulty and slid steadily downhill from there.  Up next was the topic of data structures.  We started with a few classics such as LinkedLists, Binary Trees, and Hashmaps/sets (all data structures I had seen before in high school).  Everybody gangsta until the projects came along and we were essentially tasked to create our own implementations of these data structures.  It was at this point that my latest academic revelation came to me.  These data structures do not just “exist” as I had previously thought.  They are not some inherent component of Java or any other language for that matter.  Someone had to think of and create it.  Woah.  Once this was realized, I began to glean the true innovative potential of CS theory. I also finally began to understand the “engineering” spirit within software.  As we dove deeper and deeper into data structures and familiarized ourselves with Heaps, KD-trees, and Stacks/Queues, I became increasingly fascinated by both the existing and potential possibilities for innovation.  I grew to love the projects and have never been more willing to stay up until 4 AM.  

An example of where to use Dijkstra's: Find the shortest path tree from root 0.

If data structures offered exciting, logical, left brain puzzles, then algorithms (the third and final part of the class) could give my left brain a semi.  The algorithms module was my favorite.  It required relatively little busy-work on my end.  I just needed to familiarize myself with a select few basic algorithms we were required to know such as Weighted QuickUnion or Dijkstra’s, and the rest was up to my faith in my own ability to think on my toes.  The exams and assignments became fun, and at this point we had learned enough that we were given free reign on projects.  This culminated in two projects where we had the creative liberty to employ any of the data structures and algorithms we had learned.  One was an implementation of Google Maps for the Berkeley area.  The other was a self-designed, world-based game.

Overall, I am glad I took CS 61B. The curriculum was a delight to learn and the problems really puts the brain to work. The only downside is the time commitment. I solemnly admit that this class took more hours out of my day than I was willing to sacrifice to a single class. Nonetheless, I guess time and practice are the necessary evils for success.

Food For Thought

This is a balanced binary tree. Without knowing the values in each box, which node(s) could be the median value? What if this were a Min-Heap?

Leave a comment