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.
CSC148 SLOG
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)
Subscribe to:
Posts (Atom)
