Below are some resources that I think are helpful for CSC 300 students . If you have any questions come to an SI session or leave a comment below. You can also upload any of your helpful resources in the comment section!
My Session Schedule, Spring 2016
[box]Monday 12-1pm, DePaul Center C105
Wednesday 3:30-4:30pm, DePaul Center C105
Office Hour – Monday 10:30-11:30am, DePaul Center C105 [/box]
Can’t attend any of my sessions? Check out other CSC 300 SI leaders’ schedules here.
Hey ladies and gentlemen in Java land! I’m looking forward to taking this wild ride named CSC 300 with all of you. While the task at hand may initially seem daunting, have confidence in the fact that you have one of the best professors I’ve had at DePaul teaching you the cornerstone course for your remaining collegiate career.
I took the CSC 300/301 sequence last year and can tell you one of the worst kept secrets in this major first hand: it’s extremely important. I’ve had to apply the principles and programming skills learned in this course to my higher-level courses and interviews for internships/jobs. Courses such as object-oriented software development (SE 350) and compiler design (CSC 348) rely heavily on this and the following course. Therefore, the more practice and work you put in now the more efficient you’ll be with these challenging courses.
A little about me (ignore the pink blanket)… I’m a Chicagoan born and raised. After a previous undergrad in Civil Engineering at Georgia Tech and U of I Champaign-Urbana, I decided to delay the growing up process and pick up Computer Science (it should always be capitalized) at DePaul. I’m currently a Senior with a minor in Math and I’ve also TA’ed various Calculus courses at U of I.
Outside of the coding realm I enjoy further exploring the city and keeping an ear open to new music to add to another one of my passions: music production. I’m not sure where I’ll be in 5-10 years as I’m sort of a spontaneous soul, but I look forward to the journey.
I’m excited to get to know all of you as we trudge through the course this winter quarter. I assure you that I’ll try my best to make our sessions fun and jam packed with the knowledge needed to master the evil (but not really) titan Java!
CSC 300 General Tips
While these suggestions may seem generic to some, they helped me ace this course and become confident enough to pursue the opportunity to be your SI leader
- Practice, Practice, Practice
- As professor Riely stressed and stressed in class: you must practice if you’re ever going to get this (trust me on this). The extra problems he recommends? Do them. You thought of a what-if scenario in your code? Test it. Need more creative test cases? Request them. After all that, do more problems!
- Riely’s Site is a Goldmine
- Professor Riely’s website has everything you need to succeed: examples, syntax, links to helpful resources. My biggest issue when I started my Java journey was syntax and terminology. Going through Riley’s lecture slides on your own after class or while you’re doing the homework will really cut down your referencing time later.
- Learn from Each Other
- What is an Object again? Would this work to reverse an array? Is a stack first-in-first-out? Now, you should NEVER copy another student’s code… But it is okay to ask your classmates questions when you need help. Don’t be shy! I’ve made a ton of friends here by asking questions, some of which have become my group members during higher level course projects.
- Take Notes/Draw Stuff Out
- Most of the CS classes at DePaul have exams that require you to write out code (psst… This class too). Therefore, jot down those topics that you don’t fully understand or a question that may come up in class and reach out to me or Professor Riely… We’ll answer it!
Recursion’s Revenge (Week 2: 1/12 – 1/14)
Cue the ominous tones recursion has returned (pun absolutely intended)! **ominous tones begin…**
So, Professor Riley ran through recursion in Thursday’s lecture (1/14/2016) and since a good number of you seemed to understand hw1b I think you all have a good outlook on how iteration works and more importantly, how it looks! Buuuuuut… as another example (and in my opinion, the easiest to see) here’s the Fibonacci series in its recursive form in Java (note the syntax and incrementing):
And here’s it’s corresponding tree visualization (start thinking this way, it’ll make data structures a heck of a lot easier from here on out):
Super Stacks! (Week 3: 1/19 – 1/21)
Soooo, in class today (1/21/2016) Professor Riely mentioned stacks. These are awesome and simple data structures that I think you can have some fun with.
He also mentioned the two most commonly used methods: push() and pop(). These methods place data into the stack and retrieve it respectively. PLEASE see the video posted below in the Videos and Handouts section for a visual on how they operate.
Here are a few more useful functions that the Stack class carries with it that you’ll most likely apply to your next homework:
Another data structure Riely mentioned in class is the queue. The queue is a very simple data structure that carries with it the “first in, first out” approach where you’ll receive the elements in the queue in the same order that you placed them in.
Like stack’s push() and pop() methods, queue’s carry with them enqueue() and dequeue() methods that do the exact same thing for you. Like stacks, they carry with them other extremely useful methods.
Here’s a small illustration of the basics of queues and PLEASE remember to watch the video below for further insight:
Linked Lists, Let’s Go!
Professor Riely finally went and did it… he pulled out the good ol’ Linked List from his bag of tricks and introduced you guys and girls to the dreaded pointer. Not to worry, here’s a nice and simple illustration for you on how this data structure could be viewed:
As you can see above, each node in a liked list has two attributes: some value and a pointer referencing the next node in the list (really it’s the address of where it’s stored in memory but for our purposes we can simplify it).
As you can see, the final item holds a value – the string “mary” – and a reference to null. This reference signifies the completion of the list (e.g. there aren’t anymore associated nodes to point to).
Also, as you can see in the blue text, if you want to get started working with a given linked list, you need to begin with some variable that points to the first node in the list. This makes sense for the same reason that the last node points to null. You need something to reference something else. Isn’t that what we’re all here for???
P.S. Here’s a little illustration of how you all should be thinking about this problem you’ll be working on in your homework:
Objects, Objects, Objects
When you create a class definition, you make an object type of the same name. An object is basically a reference to a block that has data and methods concerning that data. First, you want to create instance variables. These tell the user, “what kind of attributes does this object have?” For instance,
Above, when we think of time, we think of what defines time. Well, that’s easy! Hours, minutes, and seconds. These are your instance variables. Now, we can take it a step further when we need to initialize these variables and give them purpose using a constructor:
The first gives a general outlook on time whereas the second is a little more involved and gives you a bit more control over your time methods… Oh! Speaking of methods:
While these technically aren’t methods within the class.. they are methods used with a newly created time object. We could have added methods within the class such as “removeAnHour()” that would take whatever time value you passed to it and set it back one hour. When playing with objects in Java, I recommend drawing them out and seeing how they’re set up so that you may easily visualize what’s happening.
Double Trouble: Doubly Linked List
(Week 5: 2/02 – 2/04)
So we’ve come to, in my opinion, a much simpler data structure in terms of visualization. What separates a doubly linked list from a singly is the fact that it has another node (in our homework’s case: last) that will keep track of the final element in our list. The nodes themselves also have pointers that reference the following item (next) and the item preceding it (prev). Take a look at a snippet from our homework:
We have a class (MyDeque) with 2 nodes that will eventually track the beginning and end of our list. They’re currently set to null because, well… We don’t have anything to reference yet. Like the last homework, we have N to keep track of the length of the list.
Also notable, in our Node class we have two pointers, next and prev that will serve as references to the item immediately after and before the item currently in the list. Now take a look at this:
A little tip while doing this week’s homework:
[box]Professor Riely provides tests for you. Look at what these tests are doing/how they’re called.
Notice that initially there is an empty list, therefore…
Wouldn’t it make sense that this homework may revolve around N?
After you nail the above idea down the rest is a piece of cake. [/box]
Hey all! Take a look at the video I posted below. It gives a really nice, thorough look at complexity. Remember that big O is basically the upper bound where theta focuses on the worst case time complexity. I’ll be posting more content soon once I hear back from Professor Riely concerning this topic. Until then, enjoy and stay tuned!
Percolate! (not the dance)
Here’s a link to a similar assignment at Princeton University. The reason I’m supplying this is because it gives a little more diagramming for the concepts involved in Percolation that you could use while drawing out your code. Please only use this as an example and picture for your code:
The purpose of this assignment is to examine your methods of developing algorithms while attained some visual representation/gratification of what your code is actually doing. I will be posting more diagrams of my own soon. Good luck and happy homeworking!
Videos and Handouts
Here’s a practical and easy way to look at recursion in Java (a little cheesy, but it helps!). You should have some experience with recursion in Python (hint: it’s the same thing). At this point it’s all just syntax. This video will also show that in a basic sense. Always remember, DRAW. IT. OUT. FIRST.
STACKS & QUEUES
Here’s a short video explaining stacks & queues and the ways they are used; I think it helps to see how they’re implemented visually (and with pretty colors :D). It’ll also help to get familiar with the terms “LIFO” and “FIFO“… You’ll see the meaning of these in the video and they’ll be a world of help when it comes to recalling these structures on an exam. **not so subtle hint**
Doubly Linked List
Here’s a short video to give you a look at Doubly Linked Lists. This should give you a good visualization of how this data structure works and distinguish it from the Singly Linked List. This should help with the MyDeque homework!
Here’s a short video explaining some of the nuances of complexity of algorithms. This is something to get you started for the second half of the class. It’ll also be a very important subject with classes you’ll be taking in the future such as CSC 321, SE 350, and even the next data structures course. Oh, and remember what professor Riely said about the distinction between O and theta!
Here’s a cool way for you to visualize specific sorts. Enjoy!