Sunday 22 December 2013

A2 result

 In the regex_match part, I didn't get any marks, everything is error~ . Before I submitted the file, my code passed all the examples which are posted on Piazza, and we went to the Help Center, TA said if we tried all the examples and the results are the same as those on Piazza, we are good. And I think the problem is that I was looking 'r' as a RegexTreeNode but not a RegexTree, hence we got all errors for the unit test. (After running the unit test of a2, the error shows RegexTree has no attribute symbol), I think a remark must be request to get a mark we deserve

Saturday 30 November 2013

Sorting Algorithms and Efficiency

sorting is the process of structuring data in a prescriptive arrangement and a vital technique for keeping things in a specific order . Even though all sorting algorithms share the commonality of comparing two values in order to see which is larger, the steps they take to analyze and contrast values are what makes them so different. 

In selection sort, the list is split into two parts, one portion consisting of elements that have already been sorted , and the remaining portion consisting of items that have not been sorted yet.The computer recognized  the sorted and unsorted portion by  placing a break point before the first element then  repeatedly searching for the smallest/largest element in the unsorted portion, swaps it with the first element in the unsorted section and moves the break point one step to the right.

Merge sort is a sorting algorithm that uses a ‘divide and conquer’ approach to sort  data items. First, it recursively divides the array into two sub-arrays and sorts them until the sub-arrays each contain a single element.
Quick sort is a recursive sort that also adopts an effective ‘divide and conquer’ strategy but noticeably differs from Merge sort because it does not require more storage .A quick sort first marks a pivot value then divides the array into two parts, one section consisting of values smaller than the pivot value, the other consisting of values larger than the pivot value. When this process ends, the pivot value is then placed in the middle of these two parts, bringing everything together.


Efficiency is a fundamental part of computer science and, as we've learnt throughout this semester, developing a solution to a problem is not enough. We also want to do this efficiently. Even though there are several sorting algorithms, we want to implement a sorting algorithm that achieves maximum productivity with the least amount of effort and time. The efficiency of an algorithm is often conveyed by the amount of time it takes to run in relation to its input and order. The order can be expressed with the capital letter 'O', a representation dubbed ‘Big-O notation’ which is a common way of representing algorithm efficiency. 

Friday 22 November 2013

a2 result

In the regex_match part, I didn't get any marks, everything is error~ . Before I submitted the file, my code passed all the examples which are posted on the Piazza, and we went to the Help Center, TA said if we tried all the examples and the results are the same as those on Piazza, we are good. And I think the problem is that I was looking 'r' as a RegexTreeNode but not a RegexTree, hence we got all errors in the unit test. (After running the unit test of a2, the error shows RegexTree has no attribute symbol) So, we gonna request a remark i guess

Wednesday 13 November 2013

termtest2

I am preparing for term test 2. It must be a bit harder than first one because of binary tree and recursive functions. However, I believe the most important challenge is that there are few questions which worth big marks. It is so easy to lose a large percentage.

Tuesday 12 November 2013

Algorithm Complexity

In the early computer course, the only thing we care is the final performance of our coding, but we should also care about the time and spaces required to preform the operation since we have limited hardware and humans dont live forever. To minimize the time/space used, we should first find out the order of our function which can be constant, logarithmic, linear, quadratic, cubic, exponential or even worse , and if we have different Algorithms which done the same task , the best-order one is prefered. 

Thursday 31 October 2013

feeling before assignment 2

When  I  want to have some review for the assignment 2, i am really kind of confused .  While I look at the slides and the example in class , I think they are like fragments and can not help me understand the stuff thoroughly. I really think a self-study based course like csc148 should have a video lecture like csc108 , the video does not  take a lot of time and help me prepare the lecture perfectly. i think all the tree stuff is easy to understand but the coding a kind of hard , the recursion really kind of confusing when combined with other stuff.

Thursday 24 October 2013

Midterm

After this midterm , i find that i am lack of basic knowleage about python , i did not know how to get the minimum of list of tuple which made me lose amost all marks on Q 1 . i think i really should put more effort on this course. i also find the exercise getting much more complex than before, i hope i can catch up.