This week we learned about sorting, which was also a topic on CSC108 and CSC165.
Before starting to discuss the different kind of sort, it is important to know that the focuses here is on the size of input, n. How does input size affect the time requires to produce output with different kind of sort (algorithm)?
Sometimes, the list might already be sorted, but what we care about more is the maximum steps (the worst case) require to sort a list. We call this big-O, or O(n), where in this case it means the maximum steps to sort the list with size n is n (or it runs no more than n steps).
My CSC148 SLOG
this is the CSC148 Winter 2014 courSe Log (SLOG)
Wednesday, April 2, 2014
Friday, February 28, 2014
Week 7: Recursion, Linked List, and Copy
I realized that I've already written the recursion topic on week 4, so I will write mainly on linked list this week.
Sunday, February 16, 2014
Week 6: Trees
(Since it is reading week now, I think it is a good idea to catch up with the slogs I've missed)
This week, we learned about 'trees', a common way to store information. The example the prof gave focus more on the binary tree. Also, as I read through more articles about trees, I came through a paragraph talking about the difference between "data type" and "data structure".
This week, we learned about 'trees', a common way to store information. The example the prof gave focus more on the binary tree. Also, as I read through more articles about trees, I came through a paragraph talking about the difference between "data type" and "data structure".
Sunday, February 9, 2014
Week 5: Scope & Namespace,
This week we reviewed how python stores variables and learned how it search for certain variables (names). The prof also talked about A1 and showed as the 'move_cheeses' function using three stools.
Sunday, February 2, 2014
Week 4- Recursion, A1
This week the prof talked about recursion. I think it is a really useful technique and it will definitely help me in the future writing more complex functions. Below I will briefly write about what I learned about recursion, how I feel about it, and some tips I found for myself to improve writing recursion.
Thursday, January 23, 2014
Object-Oriented Programming
The first topic is going to be about Object-Oriented Programming, or OOP in short.
OOP is a style of computer programming. The main focuses on OOP is, as its name implies, object. During last semester's CSC108, we learned that a program processes an input (data) in a logical procedure and produces outputs (data). However, OOP looks at the task in a different way, instead of finding ways to 'write' correct procedures, it cares more about what is the important object in the program and what does the object do. It is like focusing on a sentence in a different way, a normal program looks for the verb, and OOP looks for its noun. Usually, a class is a collection of objects, and the things the objects do are methods.
Some Pros:
Object-Oriented Programming sounds like a new thing, but it actually works pretty well with what I've learned in the first semester. Although I haven't had many experience with it. The part that most appeals to me about OOP is its well organization, it involves lots of thinking before actually writing the program, and that's why I like it! I can have a better view of the program and know where to check if there's a problem. Hopefully I will learned more about it as the semester goes on.
Here are some links I found useful/interesting while writing this post:
Object-Oriented-Programming-Concepts
How I explained OOD to my wife
OOP is a style of computer programming. The main focuses on OOP is, as its name implies, object. During last semester's CSC108, we learned that a program processes an input (data) in a logical procedure and produces outputs (data). However, OOP looks at the task in a different way, instead of finding ways to 'write' correct procedures, it cares more about what is the important object in the program and what does the object do. It is like focusing on a sentence in a different way, a normal program looks for the verb, and OOP looks for its noun. Usually, a class is a collection of objects, and the things the objects do are methods.
Some Pros:
- It is organized and easier to understand the program if constructed carefully, since you separated it into different classes.
- We can reuse the classes that have been created in our new class. (Also called "inheritance".)
- We can reuse names for methods that functions differently in different classes, no more naming problems:D (Also called "polymorphism".)
Object-Oriented Programming sounds like a new thing, but it actually works pretty well with what I've learned in the first semester. Although I haven't had many experience with it. The part that most appeals to me about OOP is its well organization, it involves lots of thinking before actually writing the program, and that's why I like it! I can have a better view of the program and know where to check if there's a problem. Hopefully I will learned more about it as the semester goes on.
Here are some links I found useful/interesting while writing this post:
Object-Oriented-Programming-Concepts
How I explained OOD to my wife
Subscribe to:
Posts (Atom)