Data Structures
This course is a continuation of "Introduction to Computer Science" but the emphasis is now on data
structures, their implementation, application, and (informally) their efficiency. Goals include:
learning dynamic allocation and templates; comparing alternative implementations of user-defined data
structures in terms of use, complexity, and practical performance; choosing appropriate data structures
to represent the data for intermediate-level programs/problems; exploring recursion, particularly with
sorting and tree traversal algorithms.
The following are a few of the more memorable moments from the class:
---
- Ali: Whoever answers this question correctly will get a candy bar.
- Class: What if more than one person answers it correctly?
- Ali: Hmm, in that case, they will be fun-sized.
---
- Ali: [Reluctantly gives a Milky Way to Madeline] Here...
- Madeline: Thanks.
- JingRu: I am still waiting for my candy bar.
- Ali: Really?
- JingRu: Yes. When can I have it?
- Ali: When did you answer one of my difficult questions to claim one?
- JingRu: I didn't. I just want it.
- Ali: Fine! Here, you can have mine.
- Corey: What, you walk around with these things in your pockets?
-
Ali: No, when I bought one for Madeline, I bought for one myself too. [Gives his Milky Way to
JingRu]. This means that you'll have to answer a lecture question sometime from now till the end of
the semester. - Jingru: Oh... Then I don't want it.
---
[For those of you who do not watch the Family Guy, the following was an excellent reference (by Juan)
to Stewie playing Pictionary in one of the episodes]:
-
Ali: [Wanting to make a profound statement about APIs, talking to the whole class] See if you
can figure out what I'm drawing [starts to draw a three dimensional wall along the lines of Walls and
Mirrors but no one gets it, of course, since he is actually using a different textbook] - Juan: It's jackal! Jackal! It's a jackal! Is it a jackal? It's a jackal! JACKAL!
- Madeline: Time!
-
Ali: IF IT WASN'T "JACKAL" THE FIRST TIME, WHY THE HELL WOULD IT BE "JACKAL" THE NEXT 10
TIMES?!? - Evan: Why didn't you just draw a blackbox?
- Ali: GA!
---
-
Ali: So, by swapping just one pair of numbers in the array, we can bring bubble sort down to its
knees. -
Todd: Yes, because if the smallest one is now at the end, it'll take forever for it to bubble back to
the beginning. -
Ali: That's right. This called an adversarial argument. It is the algorithmic equivalent of kicking
someone in the crotch.
---
- Jared: I missed you Ali.
- Ali: Yeah? What do you want?
- Jared: Can I have a hug?
- Ali: No, thank you, I don't want to be sued.
- Evan: That's OK, I can give him a hug.
---
- Ali: In the simplest case, a field can be private or public.
-
Some student: So, if I am an object of one class, can I access the private fields of another object
of the same class? -
Ali: Yes. So the rule is, you cannot touch each others' private fields unless you are from the same
class. [People laugh] Oh, come on, there is nothing wrong that. I said "fields" not "parts".
---
- Ali: Jared, why do you look annoyed?
-
Jared: I am just mad at myself. So I could have implemented the dot product with just one line of
code? - Ali: Yes. You do understand how it works, right?
- Jared: Yes.
- Ali: Good. I don't care if you hate yourself as long as you understand basic vector algebra.
---
- Ali: I will give anyone a Dollar who answers that questions correctly.
- Jared: Is it [says the right thing]?
-
Ali: There you go [hands him a Dollar] You are a dollar richer for taking CS220... Minus the money
you spent to take the class.
---
-
Ali: [Having issues while trying to compile his code] Oh, I forgot that. [More errors] Yes, yes, I
need to change this too. [More errors] That's a typo right? [More errors] Crap! [Finally gets it
right] VICTORY IS MINE!
---
-
Ali: Today, we will write a program to check if a given expression is balanced. The expression can be
arbitrarly long. And it can be arbitrarily deep. And there are four types of parentheses. We have the
normal one, we have the bracket, we have the angle bracket, and, last but not least, we have the
curly brace. [Notices no one is listening] That's the sort of knowledge that will make you a hit at
frat parties. Just tell everyone the names of the four types of parentheses. - Chris: [Whispering to Zack] Might even help to get laid.
- Ali: I HEARD THAT! [more quietly] And, no, it does not.
---
-
Ali: [Trying to clarify things, after noticing that the shape hierarcy example for inheritance has
not worked out well] If the shapes are compatible, then they will fit together, even if you have not
seen that piece before. Insert table A into slot B.
---
- Ali: How do you spell "bollean"?
---
-
Ali: Does anyone know what a functor is? [No one says anything] It is one of the coolest names in
programming. It sounds like name of a new phaser blaster but it actually means an object with only
methods and no data.
---
- Ali: So, you can pass the question to someone else if you don't know the answer.
- Todd: I think I am going to go with Chris...
- Chris: [Unaware of what's going on, since he is not listening] ...
- Ali: His name is Chris, but I call him Potter.
- Todd: Potter!
- Chris: 'Sup?