Saturday, 28 March 2015

Reflection Time!!

Wow. CSC148 was nothing like I expected, what started off as fun, turned into a nightmare right after the first test. I knew coming into the course that it would be a bit challenging, but never did I think I would be as challenged as I am feeling now. Looking back into my first week SLOG, I thought the course would be simple, fun and challenging in a sense that after a couple hours of focusing I could accomplish any challenge. But it turns out that computer science just isn't the minor for me.

   It's not that I don't like the course, or I don't like the challenge, its just that I can't think like a computer scientist. I can't see a line of code and create a mental object in my mind, and show what happens to it as you create methods or variables. And since I was taking these courses on the basis of a minor, I can now focus on my Rotman specialist.
 
  But with the horizon just around the corner showing up in the form of a final exam, whether I like the course or not, it's go time and I have to refocus on the concepts to get a good grade, and I have learned more in this course than I ever thought I would coming into the course.


Saturday, 21 March 2015

Week 9 Impressions

Binary Search Trees were the topic for the 9th week of classes. Since we were already introduced to tree's, the topic of a binary search tree wasn't too complex of an idea. It actually proved to be an efficient way to search for a value within a tree.

       I know it is irrelevant to post it within a slog, but I feel if anyone is reading this and doesn't know what a Binary Search Tree is now is your chance to learn it in the simplest way. A binary search tree is Tree, and when you have to draw out a search tree it will look in the same shape as a regular tree. What makes a binary search tree so unique is the fact that the node values it contains are sorted with the larger nodes on the right, and the smaller nodes on the left.

   As Professor Horton mentioned in lectures, a binary search tree is faster when you have to look for a value because your first step of comparing whether the root value is greater than the value you are looking for cuts the number of nodes to search in half.
 
   I think a binary search tree is only a fast and efficient if it is balanced, since if there are no numbers smaller than the root, and the value you are looking for is at the bottom of the tree, then you basically have to search the entire tree and every node within it.

   SOOO that was week 9 for me, and it was a pretty laid back week once you understood the main concept of the week.


Thursday, 12 March 2015

Week 8 Impressions - LinkedLists

Week 8 was different, if I had to summarize it in one word. LinkedLists was the main topic of the week, and after finishing trees and nodes, and connected forms of data, a LinkedList seemed along the same line of a thought process. The main idea of the LinkedList isn't that complicated when you simply imagine it, but the algorithm was a bit confusing to completely understand. I still have a couple questions...but now that the TA's are on strike Google will have to pass as a sufficient teacher.

I think after looking at the code a couple of times, and tracing through it, I can look at the code for a LinkedList and understand it, but implementing it in my code is a bitttttt further down the path. Professor Horton has done a great job so far when she is explaining the self.front and self.back concepts, and it's much more clear now than it was when they concepts were first presented.

To me a LinkedList is like a group of people holding hands to form a line. With the first person's arm connecting it themselves to the one before, and the person's body being the value, where the person's other arm is what connects him to the last person. You can also see that the first person is equivalent to self.front, and the last person is self.back.

WELLLLL, that was my impression for the 8th week of class, and it was tough, but I can't wait for the next couple of weeks of classes.



Saturday, 7 March 2015

Saying NOPE to NODES

Are all Nodes trees? Or are all Trees Nodes? In my opinion--and I'm usually right-- I think all Tree's are nodes, since a tree is a series of nodes connect through a path to a root, wouldn't that simply mean that all tree's are nodes? Week 7 was ALL NODES ALL CLASS, it took a couple minutes to actually realize that nodes were a part of trees, but once I've figured that out, it actually became a bit easier. Another big challenge I faced in class over the week was learning that a node wasn't treated like a Tree, even though both trees and nodes had a left and right child, trees don't necessarily access them, unlike a node. Nodes have present values for the left and right child- usually preset to None. 

And if week 7 wasn't challenging enough with all the new information on nodes thrown at us, we were working on the new concepts of Nodes in our lab as well, and we awesome as my TA is at helping us, its still a tough concept to entirely understand it in just 2 classes and 1 lab. I know this is one of my shorter SLOGs but week 7 wasn't too long of a week for me to rant/reflect upon.

Friday, 20 February 2015

Recursion Take Two

Even though I've practiced it a couple of times, recursion is a challenge I continue to hate. In Assignment 2 I was forced to implement a recursive function but I'm still a bit iffy about it. Its not impossible to write a recursive function because of the steps that have been nailed into my mind; Step 1- What is the base case?, and step 2- Take the base case and make it recursive. As simple as that may sound, writing a recursive function is a bit tricky.

I love to trace a recursive function, I can do that in my sleep haha, but the thought of writing a recursive function is a challenge that I don't want to face, even though i know it will reappear on the second midterm.

The base case if you didn't know by now, is the simplest case that doesn't require recursion, it usually will be part of an if statement, that returns a generic statement such as; Return False, or Return 1; and after that the 'else' statement is the recursing one. Through my experiences when writing a recursive method on trees, the recursive part is usually [ method name (x) for x in [child or node...etc]]. As struggling as a recursive method may be and the fact that I haven't really used it unless told too, I fell recursion is a tool I should wield in my computer science tool belt.

Monday, 16 February 2015

Object Oriented Programming

    Coming into CSC148 I did't know much about objects and how they were seen when coding, but as the course progresses I think i'm getting a better handle on the unique concept. If I am not mistaken, and if I refer back to the diagrams Diane would draw on the board when she explains objects in code, I think objects are chunks of memory that the computer reserves for certain data. I remember Diane would draw boxes and call them objects, and when she would refer to it she would connect the boxes with lines, and that is the design of objects that come to mind when I think of objects. All in all though, I think that knowing how objects work, the imaginary function, creation and implementation of objects are a valuable assets for computer scientists, since they can always use it when they're lost in the jungle of their own code.

   As the course progresses I hope to implant and fortify the idea of objects in my mind for future courses, but to this day i think objects are these chunks of data that reserve information and values in them, and if i am ever confused about objects and how they're data types are assembled i refer to the python visualizer

Sunday, 8 February 2015

reCURS[E]sion

I've found recursion to be like a maze. A maze that can trap an individual if it is not traced through to perfection. But as we work through recursion in class I've learned that recursion is a tool that every computer scientist should have equipped in their tool belt. It's capability to turn code from 15 lines of reoccurring for and while loops, and if statements, down to 4 lines of recursing code, just proves that it can change anyones code...IF USED CORRECTLY. I've learned it the hard way, but trying to use your own form of recursion can leave your computer in an infinite loop, forcing you to force quit Wing and risk losing all your code. Hopefully in the upcoming weeks I'll learn how to write my own recursive function and shorten my very own code.

As difficult as recursion is, I have figured out a couple of tricks when tracing through a recursive functions, well through the examples we've been presented with in class. First, I've learned is that most recursive functions start with a conditional statement, Ex: If L is list, or X is str, so by going through that first and seeing what parameters are being passed into the function, sometimes you don't even have to proceed to the recursive part. But sometimes we do have to trace through the recursive part, and when this happens another pattern that I've seen -or maybe that's just how recursive functions are written- is that after the initial condition fails, the proceeding part has a For Loop. When tracing through the for loop, I treat it as if I'm performing the distributive property with the function, onto each element of the iterating portion of the function. By doing so I prevent myself from getting stuck in the maze of a recursive function. Follow these 2 rules, and I know anyone can trace through a recursive function as easy as I do.

Saturday, 7 February 2015

My first few weeks in CSC148

       I'm writing this blog a bit late, and it has been 4 weeks in CSC148 instead of 3, but entirely this course has been an eye opener for me. Since computer science isn't my declared major or specialization - I'm doing it as a minor, I'm currently in Rotman and hope to specialize in Accounting- I haven't prepared throughout high school for courses like this. My mentality when I started this course was similar to any other non-computer science student. When given a problem to solve in class or an assignment, I would tackle it head on, I assumed that if I did this problem once before the process to answering it again would be the exact same. But in CSC148, I've learned that that isn't always the case, that there are multiple ways to solve the same solution, all of which are correct. Over time in this course as the weeks progress and the lectures begin to accumulate, I am learning more about the course and how to program as a professional, but I am also learning how to solve everyday problems, through analytics and looking at a situation from all perspectives.

       CSC148 has been a unique experience thus far, and it continues to grasp my attention with all the neat  things were are able to do simply by coding. I am guaranteed that every week I learn a new topic or I further enhance something I thought I already knew. It is learning environments like the ones CSC148 creates, that make UofT a world recognized school, if not lectures, then it is the amazing TA's that assist you throughout the labs; even the assignments so far have been fun..once you understand what you have to do. I can only imagine that with this path of computer science, where I will end up.

Saturday, 24 January 2015

Week 3 SLOG:

"Why Geeks Should Write"? When given such a unique topic my initial reaction was probably like a lot of other students in the class. "I am no geek". Then I looked back at my past couple of weeks in CSC148, too all the different types of people I've talked to, and how anti-social some of the students were, and how different we all are. But at the same time I've learned and enjoyed so much in this course I can't help but feel like a geek. 

      Now back to the topic at hand, "Why geeks should write". Remembering what Diane had said in the lecture when she was talking about this topic about how research has proven that writing about what you've learned actually helps with remembering the content, and to me that seems true. I feel that when you teach others about certain topics, you yourself are learning the topic and testing yourself to see if you actually know the material. Which is why I enjoying teaching others what I've learned in these computer science courses because it helps me remember and really harness the main concepts that are taught. Concepts as basic but crucial such as "self.[method]", or "NotImplementedError's". CSC148 thus far has taught me to much to put in the slog, but over the next couple of weeks I intend to let it all out.