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.
Monday, 14 October 2013
Object-oriented programming and recursion
One thing we have studied recently in csc148 is Object-oriented programming. Object-oriented programming is a programming paradigm that makes the functionality and data together into an object, and python is an object-oriented programming language. The object-oriented programming in python consists of two parts , class and methods , the class is a user-defined prototype for an object that defines a set of attributes, and the method is a kind of function defined in the class. The class has an __int__ (initialize) method which is used to set up attributes and new instances . I think Object-oriented programming provides a very clear modular structure , and easy to modify when there is only a slight change to the existing code , overall , it's clear structured and intelligible.
I consider recursion as the hardest thing I learn in this course. To use recursion , we should divide the problem into some sub problems , and solving the problems by calling the sub problems. The recursion really makes some complex questions easier , and it's really hard to come up with the idea in the first place . By the way , the recursion requires a case outside it to make itself finite.
Tuesday, 8 October 2013
recusion
This week the recursion has been introduced to us , i think the recursion is a easy way to do the problem which use a lot of loops in the past , but it's not as easy as for loop in the beginning.the idea is so hard to come up with to start coding , but it is impressive to see a method done in one line.
Tuesday, 1 October 2013
Some feeling for the first month of CSC148
For the first month , I learnt some basic but useful material for this course, some of them, like Testing , are material from 148 , and other like recursion are totally new material. I find that some of the new material is really challenging , especially recursion.
I also have a advise for this course, i find out that the video before the lecture in CSC108 is very useful ,but I don't know why there is no such thing in 148.
I also have a advise for this course, i find out that the video before the lecture in CSC108 is very useful ,but I don't know why there is no such thing in 148.
Subscribe to:
Posts (Atom)