I decided to revisit one of my previous posts on binary trees, and I was right. Even though, some problems are easy to solve recursively with trees, some problems are still somewhat difficult to wrap your head around.
An example would be Assignment 3 (though we were working with trees, not binary), the last function proved to be somewhat of a challenge. It was not something that was easy to write within a minute or two. Our group had to think carefully about this problem and took us a while to complete it.
I also took the time to look through some slogs of my peers and it seems like Timothy(link) has fairly similar experiences to mines! Though to be fair, it's probably a common feeling within many of my peers after having experienced this course.
Monday, April 6, 2015
Final Chapter
This is the last post of this semester, I say farewell as I recall the fond memories that I obtained in this course. I learned many new things, the main things being data structures. I thought that it was a good introduction course to different algorithms and various methods we can use to approach different problems.
I don't know if it's just me but... I feel like classes went by a bit slow and it feels like we took many classes to discuss one topic that could have taken less time. I was thinking that instead that time should be used to teach various applications of the data structures and more hands-on stuff. But, I still loved it!
One thing I have to say is that this course was a huge jump from CSC108. I was talking to a friend that dropped out of this course, and she said that 108 was extremely easy but she had no ideal what the hell happened in 148!!
Overall, I loved this course!!! BYEEE
I don't know if it's just me but... I feel like classes went by a bit slow and it feels like we took many classes to discuss one topic that could have taken less time. I was thinking that instead that time should be used to teach various applications of the data structures and more hands-on stuff. But, I still loved it!
One thing I have to say is that this course was a huge jump from CSC108. I was talking to a friend that dropped out of this course, and she said that 108 was extremely easy but she had no ideal what the hell happened in 148!!
Overall, I loved this course!!! BYEEE
![]() |
| idk wat |
Sunday, March 22, 2015
Week #10: Test 2
We just finished the last test of the semester for this course. I felt that this test had much more requirements than the first one. The main focus of this test revolved around trees and linked lists. I believe that this test was fair and it was mainly questions that we would know how to do if we had properly completed the labs.
But, I think that handwriting code on tests just make things more difficult. I understand that writing pseudo-code and plans on paper is important to organize your train of thought. However, writing code by hand often results in careless bugs and syntax errors. It's not really a good representation of real life scenarios.
Week #9: Linked Lists
This week we learned about a new data structure, linked lists. I felt that this data structure is much more logical than recursive procedures. Even though you have to write much more code that recursive functions, iterative functions feel much more natural. Even though I love recursion I feel that iterative functions have some more advantages.
First of all recursive functions are less efficient, not sure about this but I believe if you can write it iteratively it would be more efficient to do it that way. Secondly, I feel that iterative functions are simpler to debug and test.
I thought it was interesting to learn about linked lists. It is a mutable data structure, it can probably increase efficiency in many cases in the future..
First of all recursive functions are less efficient, not sure about this but I believe if you can write it iteratively it would be more efficient to do it that way. Secondly, I feel that iterative functions are simpler to debug and test.
I thought it was interesting to learn about linked lists. It is a mutable data structure, it can probably increase efficiency in many cases in the future..
Sunday, March 8, 2015
Week #8: Binary Trees
The next concept that we learned after trees were binary trees. Basically binary trees are the same thing as trees except that each node only has a maximum of two children. Each node is usually defined as having a left child and a right child.
Before I learned about trees I had heard about the concept of trees from a friend. I didn't really know how it worked and it sounded extremely complicated. However, now I know that trees are a type of ADT. Trees are easy to setup but sometimes I find it difficult to traverse trees with recursion.
I feel like I still need a lot more practice with recursion problems. Usually, I can get a general solution but I can't fully implement the code.
Before I learned about trees I had heard about the concept of trees from a friend. I didn't really know how it worked and it sounded extremely complicated. However, now I know that trees are a type of ADT. Trees are easy to setup but sometimes I find it difficult to traverse trees with recursion.
I feel like I still need a lot more practice with recursion problems. Usually, I can get a general solution but I can't fully implement the code.
Sunday, March 1, 2015
Week 7: Object-Oriented Programming
I'll pick my SLoG entry for week #6 to be assessed for the summary of OOP programming.
This week we continued recursion, but mainly focused on the idea of binary trees. Binary trees are data structures where each node only has a maximum of two successors. I know that trees is an important data structure that needs to be used for Assignment 2. However, I'm still a bit iffy on the concept of trees and recursion. For example, using recursion to find the longest path. I made the function work but I don't really understand how it returns the length of the longest path. How did the recursive procedure itself count the nodes? This is definitely an area that needs to be improved for problems in the future.
This week we continued recursion, but mainly focused on the idea of binary trees. Binary trees are data structures where each node only has a maximum of two successors. I know that trees is an important data structure that needs to be used for Assignment 2. However, I'm still a bit iffy on the concept of trees and recursion. For example, using recursion to find the longest path. I made the function work but I don't really understand how it returns the length of the longest path. How did the recursive procedure itself count the nodes? This is definitely an area that needs to be improved for problems in the future.
Monday, February 16, 2015
Week 6: Object-Oriented Programming
I believe that Object-Oriented Programming is a very powerful and extremely useful feature for higher level programming languages. Personally, I love the features that Object-Oriented Programming provides. I remember when I had to create a simple zombie shooter game using only functions.
I'm going to try to give a summary of Object-Oriented Programming in the style of a guide geared towards people who wants to learn Object-Oriented Programming.
I like to compare Object-Oriented Programming to blueprints and the item that can be built from these blueprints. In python terms when we program a class, it's kind of like creating blueprints for an object. Then, with that class (blueprints), we can create many instances of that class.
It's easier to understand with an example. In python this is how we create a class for a person.
class Human:
def __init__(self, eye, skin, height, weight, hair):
.code here.......
.code here.......
.code here.......
Basically, the code above is kind of like the blueprints for creating a human, and whenever we create a human object we can initialize it with his/her eye color, skin color, height, weight, and hair color.
In Python, there are many special procedures that we can define within classes. Some of the ones that I'm familiar with are __eq__, __str__, __repr__, and __init__.
The __init__ method is required for all classes and basically it is used to initialize an instance of the class. The __str__ method is used to print out what the class does in a human readable form. The __repr__ method prints out a representation of the class with its values. Finally, the __eq__ method allows you to compare two objects and whether or not these two objects are equal.
(**Note: On the website it says to write on OOP for week #6, but on handout it says to write it for week #7. I don't think it really matters, so I'm writing on OOP for week #6)
I'm going to try to give a summary of Object-Oriented Programming in the style of a guide geared towards people who wants to learn Object-Oriented Programming.
I like to compare Object-Oriented Programming to blueprints and the item that can be built from these blueprints. In python terms when we program a class, it's kind of like creating blueprints for an object. Then, with that class (blueprints), we can create many instances of that class.
It's easier to understand with an example. In python this is how we create a class for a person.
class Human:
def __init__(self, eye, skin, height, weight, hair):
.code here.......
.code here.......
.code here.......
Basically, the code above is kind of like the blueprints for creating a human, and whenever we create a human object we can initialize it with his/her eye color, skin color, height, weight, and hair color.
In Python, there are many special procedures that we can define within classes. Some of the ones that I'm familiar with are __eq__, __str__, __repr__, and __init__.
The __init__ method is required for all classes and basically it is used to initialize an instance of the class. The __str__ method is used to print out what the class does in a human readable form. The __repr__ method prints out a representation of the class with its values. Finally, the __eq__ method allows you to compare two objects and whether or not these two objects are equal.
Another feature of Object-Oriented Programming is inheritance. We can make a class and then inherit and use all of the methods from another class. Using the example above I can make something like...
class HumanChild(Human):
....code here
This HumanChild will then be able to use everything from the Human class and we can implement more procedures that would only apply to a child class rather than the general Human class.
We could go more into depth about each section of the code, but this is just a quick general overview of Object-Oriented Programming.
We could go more into depth about each section of the code, but this is just a quick general overview of Object-Oriented Programming.
(**Note: On the website it says to write on OOP for week #6, but on handout it says to write it for week #7. I don't think it really matters, so I'm writing on OOP for week #6)
Sunday, February 8, 2015
Week 5: Tracing Recursions
When I first started learning recursion in high school, we directly started learning from the base call and recursive call; we didn't do any recursion tracing exercises. When we first started to do recursion tracing exercises I felt that it was really weird and personally I didn't like the process of tracing recursion. Even though this is the approach in how we think about recursion, I had difficulty writing out the exact steps of recursion.
For example if there was a recursive function like count(x) that took a nested list as input and flattens it into a single list. I know how the recursive idea works, but I'm not used to tracing it and writing out what happens at each element in the list. I think that after you get the general idea of how recursion works, tracing the functions is not necessary. But, it would still be useful for some complex functions that are difficult to understand.
For example if there was a recursive function like count(x) that took a nested list as input and flattens it into a single list. I know how the recursive idea works, but I'm not used to tracing it and writing out what happens at each element in the list. I think that after you get the general idea of how recursion works, tracing the functions is not necessary. But, it would still be useful for some complex functions that are difficult to understand.
Saturday, January 31, 2015
Week 4: First Impressions
As I first attended the CSC148 lectures, I immediately felt the difference between this class and CSC108. CSC108 was an introduction to programming and every lecture was very specific and detailed, but also moved at a slow pace. When I started CSC148, the lectures moved quickly between different concepts. We did abstract data types, inheritance and now recursion. The materials move at a much quicker pace. Also, assignment 1 was extremely vague compared to the assignments in 108, where they told us exactly which functions to write and how to write it. I'm actually enjoying the pace of 148 much more than 108, and I like it when we get more freedom in how we want to code our assignments.
Thursday, January 22, 2015
Week 3: Why Geeks Should Write
Writing is an essential skill for everyone, and I'm not referring to writing code! It may seem strange that computer scientists are required to write articles or blogs, but it's an essential part of communication between everyone else around the world. What do you think would happen if programmers never documented any programs that they wrote. Imagine trying to use an operating system like Linux without documentation, it would be downright difficult or impossible to use.
A good example from class would be Object-Oriented Programming. When we want clients to use the code(classes) that we created we have to make sure that the documentation is succinct, and easy to understand while relaying all the necessary information to the users.
In short, writing good articles/guides/blogs is an effective way for computer scientists to communicate their thoughts, feelings, or opinions. They can also write articles teaching/informing others on a particular subject. This is a blog that I found from the creator of Joe, a trending repository on GitHub. Since he wrote this article, he can relay to others his thoughts and how his project became viral.
So, I think that all geeks should give writing a go. It can be used to shout out your feelings, or maybe you just want to share your knowledge in programming with others. Whatever it is, you should just do it.
A good example from class would be Object-Oriented Programming. When we want clients to use the code(classes) that we created we have to make sure that the documentation is succinct, and easy to understand while relaying all the necessary information to the users.
In short, writing good articles/guides/blogs is an effective way for computer scientists to communicate their thoughts, feelings, or opinions. They can also write articles teaching/informing others on a particular subject. This is a blog that I found from the creator of Joe, a trending repository on GitHub. Since he wrote this article, he can relay to others his thoughts and how his project became viral.
So, I think that all geeks should give writing a go. It can be used to shout out your feelings, or maybe you just want to share your knowledge in programming with others. Whatever it is, you should just do it.
Saturday, January 17, 2015
Week 2: Lab of CSC148
In this week's class we covered new material that I was not familiar with. We started to learn about abstract data types (ADT). The first ADT that we learned was called a stack. Basically, a stack can only have a few operations such as adding an item to the top, removing an item from the top, and checking whether or not the stack is empty. We then saw an implementation of a stack in Python using classes.
I also had my first CSC148 Lab this week. I find the way that these labs are set up are quite interesting and also helpful. Basically, we alternate between a driver (the person coding) and a navigator (the person who tells the driver what to code) when we are completing the tutorial assignments. These labs are really helpful because it helps us get used to reading and building onto other people's code.
Monday, January 12, 2015
Week 1: An Introduction to CSC148
I just finished the first week of classes for CSC148. My professor is Danny Heap, the same professor that I had for CSC165. I know that Danny is a great professor so I'm expecting great CSC148 classes.
After I looked at the syllabus, I'm actually really excited for the topics that we will be covering in this course. Topics such as recursion, linked data structures, and sorting sounds interesting and seems like it is a basic, but required knowledge of the algorithms in Computer Science.
In the first two classes we basically basically reviewed Object-Oriented Programming from CSC108. We touched on some classes, and defining functions within classes. Currently, the material seems to be okay. I look forward to the new topics in this class!
After I looked at the syllabus, I'm actually really excited for the topics that we will be covering in this course. Topics such as recursion, linked data structures, and sorting sounds interesting and seems like it is a basic, but required knowledge of the algorithms in Computer Science.
In the first two classes we basically basically reviewed Object-Oriented Programming from CSC108. We touched on some classes, and defining functions within classes. Currently, the material seems to be okay. I look forward to the new topics in this class!
Subscribe to:
Posts (Atom)
