Thursday, 28 November 2013
Week 10 & Last Week!
This week we have a topic about sorting algorithms. Out of the sorts (selection sort, quick sort, merge sort) it seems that merge sort is the fastest of the 3 sorts. Of course, it depends on the elements given, such as if the list is small selection sort would be fast while quick sort depends on the pivot in which it sorts around. The efficiency of algorithms is important as the speed in which it solves problem may mean 1 minute or 1 hour. Of course, selection is also the easiest to implement. We also learnt about timsort and although we did not know the code, it turns out it is a hybrid of all 3 where it takes the best way to sort these elements. It other words, it takes the best possible route/ most efficient in order to sort numbers. Also this week is the last week (ish) of school! Exams are coming up and this will be my first time writing a final exam at the university. Hope everybody good luck on their exams!
Wednesday, 20 November 2013
Week 9
I got my test back this week and I got perfect on it :) In this week we learned about reduce and maps in python as well as property set in order to encapsulate all the variables in python. Although this is given (and enforced) in other languages such as C++ and Java, this tool was implemented later as python started as a function programming languages. I wonder if the final exam for test is hard as there now will be an enforced 75% rule on taking 200 CS courses. I wonder what the future of UofT CS department as it has grown to such a high demand from students that there are no more spots for even computer science students. I am hoping that the department will expand the a size where everyone will be able to fit.
Wednesday, 13 November 2013
Week 8
This week I went to Yale Hack and it was fun. More information on http://www.y-hack.com/. At Yale hack I met a lot of sponsors and other programmer from around North America. I designed a nutritional calculator that creates custom meal diet plan. https://github.com/firedark60/Nutritional-Calculator . This week we also had a test 2. It was pretty easy because it was based off the assignments we had from class. I feel Danny could have made this test harder because although I do enjoy an easy test, if a test if not challenging it makes me less motivated to study for the next test. Overall, this week was fun and simple because we had not class (from university closing)
Monday, 4 November 2013
Week 7
This week my mine was blown when Danny implemented quicksort in 1 line because I expected it to take longer in order to implement it. An interesting point of binary search on trees is if I am only looking for one particular item only once then it makes more sense to leave the tree unsorted as it cost more resource to sort and balance the tree than to just traverse the tree. But it also important to note once you have balanced the tree, you can search the tree of a very low cost of log n. The question being is when to sort the tree to save time in the long run or to save time now instead of sorting and just find it. And to sort these structures it shows it is important to use a efficient algorithm to sort otherwise more resources are used unnecessary in order to find an item
Wednesday, 30 October 2013
Week 6
Well I we got our midterms back and I'm happy to say I got 90+% Yay! Also my assignment 1 I have requested a remark because of a mismark on the assignment. The study on binary trees and efficiency this week is very interesting because i do prefer learning about the theoretical stuff and applying it right after. I found this show call "Extra Credits" that teaches how to game design on youtube which I may find useful in the near future. We got our assignment 2 this week which was something I have not done before as regular expression was not the usual programming I have done but I still found it interesting because learning something new is always good. We are working with sorted tree this week for exercise 6 and I feel weird how we are told not to use recursion. I think Danny is getting to my head with only use of recursion because now I can barely program without recursion (he wins this time).
Monday, 21 October 2013
week 5
This week we had an assignment where we create a binary tree using a preorder and inorder traversal. It was probably the most interesting one so far because this one required more thought than the other ones. This is where recursion helped a lot because the tree can be broken down to its node, left, and right. We also had our first test which was easy enough to do. My mistake was my test case required to test an empty list.
Sunday, 13 October 2013
Week 4
This week we don't have an excersize or an assignment but there was an interesting lab. The most interesting thing in the lab was converting decimal to any k base (under 9) number using recursion. Its thanksgiving so we don't have anything for programming but personally I am writing a website to profile myself as a side project outside of school. More interesting things next week!
Tuesday, 8 October 2013
Week 3 (OOP & Recursion)
So this week we have a topic! OOP and Recursion!
Well anyways, this week has been tiring and honestly quick hectic. Working on assignment 1, it took wayyy longer time than I expected. The first couple of steps was a breeze but when it came down to solving Tour with 4 cheeses (Reve's Puzzle according to Wolframalpha (which I recommend you to check out)) to be frank was a very difficult problem. Also trying to learn read and learn Tkinter in a week was not exactly easy either. Anyways, I survived and I finished the project, but I did not make Controller.py because if I did, it was purely for the sake of making the class to satisfy the optional requirement and not for saving code (as my Solver and Manual were almost completely different). Enough with this and time to get my opinion on OOP and Recursion (if you care)
OOP is probably the best thing ever. OOP, or object oriented programming, is making a set of code in which it can reused and make multiple instances of by another code. It allows me to make 1 set of code for something and keep reusing the same code with different constructors to get different thing. I honestly don't know how to program large scale program without OOP because that was the only way I learnt how to program. That might be why I don't like Python so much because it (technically) is a scripting language and OOP was added later. OOP is what industries use to make large program as it can then divide up the work into smaller parts. In my opinion, OOP is the only way to go.
Recursion is the idea of calling itself (the function itself) in order to solve a problem. Recursion is very mind boggling in the sense it can make large scale problems into seemingly small ones. An example would be the Tower of Hanoi as the recursion is used to solve this type of problem. It's useful in the sense it can solve problems quite efficiently, but I myself am not very good at it and would prefer to iterate. It is true Recursion is cleaner and a better solution, and in some scenarios the only way to go, but as a student, I still lack the skills into solving problems with recursion, hopefully I'll get better at it. Still very mind boggling every time I make a depth first search with it.
Well anyways, this week has been tiring and honestly quick hectic. Working on assignment 1, it took wayyy longer time than I expected. The first couple of steps was a breeze but when it came down to solving Tour with 4 cheeses (Reve's Puzzle according to Wolframalpha (which I recommend you to check out)) to be frank was a very difficult problem. Also trying to learn read and learn Tkinter in a week was not exactly easy either. Anyways, I survived and I finished the project, but I did not make Controller.py because if I did, it was purely for the sake of making the class to satisfy the optional requirement and not for saving code (as my Solver and Manual were almost completely different). Enough with this and time to get my opinion on OOP and Recursion (if you care)
OOP is probably the best thing ever. OOP, or object oriented programming, is making a set of code in which it can reused and make multiple instances of by another code. It allows me to make 1 set of code for something and keep reusing the same code with different constructors to get different thing. I honestly don't know how to program large scale program without OOP because that was the only way I learnt how to program. That might be why I don't like Python so much because it (technically) is a scripting language and OOP was added later. OOP is what industries use to make large program as it can then divide up the work into smaller parts. In my opinion, OOP is the only way to go.
Recursion is the idea of calling itself (the function itself) in order to solve a problem. Recursion is very mind boggling in the sense it can make large scale problems into seemingly small ones. An example would be the Tower of Hanoi as the recursion is used to solve this type of problem. It's useful in the sense it can solve problems quite efficiently, but I myself am not very good at it and would prefer to iterate. It is true Recursion is cleaner and a better solution, and in some scenarios the only way to go, but as a student, I still lack the skills into solving problems with recursion, hopefully I'll get better at it. Still very mind boggling every time I make a depth first search with it.
Saturday, 28 September 2013
Week 2
Stacks and Queues are pretty easy to implement in python in comparison to other languages. Although Python is convenient, I still think Java is better. (Still biased). Lab 02 was pretty simple as instead of taking the last element, we just took the pop the first element and voila! a queue instead of a stack. Another thing I learned is its better to import stuff by using (from **** import ****) because importing the filename will require you to write filename.class (), when time can be saved by writing class (). I miss java where it all makes sense :(
>>> from __future__ import braces
SyntaxError: not a chance
:(
>>> from __future__ import braces
SyntaxError: not a chance
:(
Sunday, 22 September 2013
Excerise 1 & Feelings of Python
Well I'm glad MarkUs was fixed during the weekend this week because I was freaking out when I got E1b wrong. Luckily piazza showed everybody also had the same problem. I wasn't sure if we got it all wrong or the system was wrong but after the post on Friday that it was extended to Monday I was happy I'm not failing university (yet). Ahh the anxiety and panic that was spread on Friday... Anyways I'm still getting used to Python and for now my opinion is it's like the laziest programming language I have done (coming from a Java & C++ background). This imported comic explains how I feel about python right now.
Subscribe to:
Posts (Atom)