Thursday, October 24, 2013

Assignment 2 and Regular Expressions

"Haha! Something new to do! I bet $100 it's gonna be on recursion again." Indeed it's about recursion however, with this new assignment, a new topic in Computer Science is introduced to us: Regular Expressions. Still not knowing what it actually is, the only thing about Regular Expressions I know right now is that to convert them into binary trees are hard as hell. For the first part of the assignment, I think I just wrote the most lines I've ever done in a computer program. Still, part 2 is waiting to be solved and I'm sure that it's going to be tougher than the first part. We'll see...

Friday, October 18, 2013

Working on Exercise #4

When I first looked at Exercise #4, I said to myself: "Boy, that's gonna be hard". However, with pages of paper and pencil work, it didn't seem as hard as it was in the beginning. The key to solve this problem is recursion, again. Since I think this course is basicly mainly on recursion, it's beneficial for us to use recursion in everything we do. So, to solve the problem, all you have to do is dividing the big problem into smaller parts and solve it.

Sunday, October 13, 2013

Recursion

By definition, recursion is "a method where the solution to a problem depends on solutions to smaller instances of the same problem." My definition would be: "calling the same method from the inside of the method". Recursion is not only about methods but when I hear about recursion, recursive methods are the first things that comes to my mind. Recursion can be very useful in computer science. Like we did in the Assignment 1, you can use recursion to create an algorithm about moving n cheeses from first stool to the nth stool. Recursion is an interesting concept and sometimes a little bit hard to comprehend.

Object-Oriented Programming

By wikipedia definition, Object Oriented Progrraming is: "A programming paradigm that represents concepts as "objects" that have data fields (attributes that describe the object) and associated procedures known as methods. Objects, which are usually instances of classes, are used to interact with one another to design applications and computer programs." To make it simpler, my teacher back in highschool said the following to illusrate OOP in our minds: "OOP is just like nature itself. We are instances of Human class, our world is an instance of Planet class and so forth." On this aspect, OOP is very useful for computer programmers in sense of code repetition and convenience.