Time goes really fast isn't it? I can't believe we are nearly end of an academic year. Unlike csc108 teached me just how to use the python, this course gives me many useful idea that how to build a function.
I did pretty well on lab excercise and assignment, but still did poor on test since I still can't familiar with paper coding, I hope this course won't drop my GPA otherwise I can't imagine what can I get in further 200 and 300 level.
All in all, it was a fun semester and I feel extremly grateful to Dan and TA Bryan
CSC148H5 SLOG
2014年4月7日星期一
Week 10
This week we talked about Sorting, first we have Selection sort and Insertion sort, but these two sorting method are both slow sort since they both have O(n^2) which means they have to repeat the function in extremly lots of times, so we need to find another way which is quick sort with O(n lg n).
Assignment 2 is nicely done, the most time I spent is on 1st function, after I figured out what kind of thinking way I should go with, the rest of function becomes pretty easy since they really works in the similar way, I expect my assignment can recover my marks droped from midterm test.
Assignment 2 is nicely done, the most time I spent is on 1st function, after I figured out what kind of thinking way I should go with, the rest of function becomes pretty easy since they really works in the similar way, I expect my assignment can recover my marks droped from midterm test.
Week 9
Looks like we finally jump out from the Tree series, this week our topic is Anagrams, it seems really fun but complicated. Basically the anagram funcion is rearrange a given word and find the actual English word from a given word list such as from "deposit" to "topside" if "topside" is in the word list.
The function is base on recursion but have two different ideas, one call Permutation Approach and other call Signiture Approach. Permutation rearrange the given word to all possible value and compare if there are some word contains in the word list; Signiture is reorder the given word and all word from given word list into the alphabetical order and find if some word in list has the same.
To choose wich idea is depends on length of the word you try to anagram, Permutation works efficiently when the word is short such as "horse", but it take really long time when given long word since it need to rearrange to all possible order, in this case we use Signiture instead.
The function is base on recursion but have two different ideas, one call Permutation Approach and other call Signiture Approach. Permutation rearrange the given word to all possible value and compare if there are some word contains in the word list; Signiture is reorder the given word and all word from given word list into the alphabetical order and find if some word in list has the same.
To choose wich idea is depends on length of the word you try to anagram, Permutation works efficiently when the word is short such as "horse", but it take really long time when given long word since it need to rearrange to all possible order, in this case we use Signiture instead.
Week 8
Last week's test actually trolled me somehow, the mark is way lower than I expected, after I get the test returned, I found there are a lot of bug in my code. I should take more attension when I write code by hand writting since paper will never debug code for me.
This week we start out Binary Search Tree. Binary Search Tree is a Binary Tree with a special sorting method. A normal Binary Tree is just a tree that contains only two children, a Binary Search Tree has two children as well but the left child conatins only smaller value than the node, and all the bigger value put in right child. Certainly this would done by recursion
This week we start out Binary Search Tree. Binary Search Tree is a Binary Tree with a special sorting method. A normal Binary Tree is just a tree that contains only two children, a Binary Search Tree has two children as well but the left child conatins only smaller value than the node, and all the bigger value put in right child. Certainly this would done by recursion
Week 7
This week we talked a liitle bit about Linked list since we have midterm test on Wednsday, it seems like a lite version of tree contains only head and tail instead of having multiple leaves; unlike the normal treee, Linked list looks like a straight line or a chain, each node contains one head and refrence to rest of the Linked list. It pretty straight forward and easy to understand, I think I can put more time on study midterm.
The lab is continue on the recursion, TA provided us a lot of sample recursion functions for test review, I can quickly understand how those function works but still feel strange to create a original one.
The lab is continue on the recursion, TA provided us a lot of sample recursion functions for test review, I can quickly understand how those function works but still feel strange to create a original one.
2014年2月24日星期一
Week 6 + Reading week
This week we learned Trees, it seems everyone suffering from the midterm week include in me, which I didn't catch much about it. Tree traversal has three basic type: Preorder, Inorder, Postorder, which gaves more ways than List. Preorder is pretty straghtforward, but Inorder and Postorder seems easy to messed up for me.
During reading week, I spent a lot of time in assignment 1, before I start I thought it wasn't hard at all since I understand everything from the friday's assignment lecture, but it still took me longer time than I expect especialy in the last 2 part, after tons of tries, I found that paper work is really helpful to sovle the optimal steps for 4 pegs hanoi and the recursion function. and I found that the best number of discs to be moved in first step is half of the total discs. I hope I'm right.
During reading week, I spent a lot of time in assignment 1, before I start I thought it wasn't hard at all since I understand everything from the friday's assignment lecture, but it still took me longer time than I expect especialy in the last 2 part, after tons of tries, I found that paper work is really helpful to sovle the optimal steps for 4 pegs hanoi and the recursion function. and I found that the best number of discs to be moved in first step is half of the total discs. I hope I'm right.
Week 5
This week we continue in the Recursion, it really helps since I still haven't fully handle this staff, but after this week it seems all the confusion has been solved, now I can easily solved such like Hanoi problem.
This week lab was base on recursion, its an easy lab since the main goal is to drive the given recursion function to get the final answer, I would rather do some recursion devolope excersice, but I still enjoy the lab, it was fun.
On Friday's lecture, we had a class about assignment 1, we went throught the assignment and got many helpful hints, it seems covered all the staff we have learned so far, what a nice warm up before the midterm
This week lab was base on recursion, its an easy lab since the main goal is to drive the given recursion function to get the final answer, I would rather do some recursion devolope excersice, but I still enjoy the lab, it was fun.
On Friday's lecture, we had a class about assignment 1, we went throught the assignment and got many helpful hints, it seems covered all the staff we have learned so far, what a nice warm up before the midterm
订阅:
博文 (Atom)