I learned quite a lot in CSC148. First, ‘class’ is a key
concept in this course. We worked with it all the semester. Important examples
of class are stack, tree, and linkedlist. Secondly, ‘recursion’ is a method
that can be applied to traversing objects like tree. Furthermore, binary tree
is a special example of tree that we can traverse without going through
unnecessary nodes and therefore shorten the running time. Finally, we learned
factors that affect running time and how to minimize it.
CSC148 Blog
Sunday, 19 April 2015
Monday, 30 March 2015
This week we are asked to revisit an earlier slog posting
and see whether we agree with earlier self, and also compare our experience
with our classmates.
After revisiting a posting about recursion, I find myself
agree with what I wrote about a month earlier. However, by comparing it with a
posting of another classmate Ding, I can improve some of my views. Ding thought
understanding the algorithm of writing recursion is of great importance,
especially for complex functions. I wrote in my posting the method that I
followed when creating a recursion in the earlier posting. Indeed, I used
systematic way to write functions, so they were not so messy and difficult. Otherwise,
even though you can deal with some
functions, it is easy to get lost when you face more complicated ones. By
following methods, you can track what you are doing and figure out what
direction you should head.
Thursday, 12 March 2015
LinkedList made me confused at first. The “front” of
LinkedList seems to be everything you need to know about LinkedList, and if
printing it, you will get a complete LinkedList. It was tempting to assume that
“front” is just the LinkedList itself. But Diane gave us a great example. She
said LinkedList is like the process of treasure hunt, and front is the first
clue that leads to other clues.
Another confusion was that LinkedList is
mutable. I did not pay attention to this property of LinkedList at start, so it
was no surprise that I made mistakes in lab. However, drawing pictures really
helped me out. In this way, writing code is more comfortable and I made fewer
errors.
Sunday, 1 March 2015
This is the first time that I learn about recursion in
computer science. My first impression was that recursion seems to be like loop.
You go over a process again and again. But then I realized they are actually
very different. Recursion is not simply repeating a process, but going to a
deeper layer at the same time.
The method I follow every time I write a recursion is
basically what Danny taught us in class. The first step is to find the simplest
situation, which seems to be easy. But you have to find a return value that is
coordinate with the code you are going to write next. Then I will consider the
situation where recursion appears once and figure out the code through which I
get the right result. Last, checking with the situation where recursion appears
twice or more times is a good idea.
So far we have learnt recursions in some different scenarios
like tree, nested lists and so on. I get a rough idea when we should use
recursions. It’s when you need to apply the same thing to many layers of an
object. Peeling an onion may be a good analogy. You peel down every layer of an
onion in the same way until you get the basic layer.
Thursday, 22 January 2015
Why should geeks write
Geeks should write because they need to communicate with
other geeks. When they meet some problems in the process of programming, they
have to turn to others for help. If they cannot write clearly, others will not
catch the point of their problem and therefore not able to assist them. Being a
good writer can also help them share ideas with others. Sharing ideas is important
in the field of computer science because it is a way to combine wisdom and
generate better solutions to problem.
Geeks should write because it is
important to make people who do not know much about programming to appreciate
their work. The programming they create may be cool, but if they cannot tell
people properly and convincingly why it is cool, the programming will not be
applied and therefore useless.
Geeks should write because the
ability to write and speak in English makes them more than a programmer. They
can convince the world why people should try their product just like Steve Jobs
did. They will be businessmen, be leaders, be those who can change the world.
Subscribe to:
Posts (Atom)