This week we finally start recursion; I'm very excited because this is what I have been waiting for since the beginning of this semester. I notice that the way how the professor trace recursion is a bit different from what I learn in high school: it's more organized and simplified. To me, it is a efficient way since sometimes can get complicated and extremely difficult to trace without organization.
Also we saw an example with recursive images. In high school we also did something similar (e.g. snowflakes) which was a fun experience. Recursive images are so easy and interesting to produce is because what we need to do is only write code for one "branch" and the rest of the "branch" will self-complete, reducing large amount of time of me scratching my head and figuring out the angles between each "branch".
In general, this week is rewarding to me and I am looking forward to learn more about recursion.
Thursday, February 25, 2016
Sunday, February 14, 2016
Week 5 Entry
This week we learned more about the application of linked list.
Last week I convinced my self that linked list is more efficient than normal list, but to be honest I was not 100% sure about how efficient it can be. But in Friday's lecture, the professor showed us the actual run time using the built-in list and linked list and it's incredible to see how much faster the program become; from some exponential run-time(perhaps) drop down to linear run-time, and I can already how can I use it. For example, I wrote a program once that simulates particle effects, and as I add more particles, the frame rate drops rapidly. Now I know about linked list, maybe I can try it on that particle simulator sometimes and I'm sure it will run much faster.
Last week I convinced my self that linked list is more efficient than normal list, but to be honest I was not 100% sure about how efficient it can be. But in Friday's lecture, the professor showed us the actual run time using the built-in list and linked list and it's incredible to see how much faster the program become; from some exponential run-time(perhaps) drop down to linear run-time, and I can already how can I use it. For example, I wrote a program once that simulates particle effects, and as I add more particles, the frame rate drops rapidly. Now I know about linked list, maybe I can try it on that particle simulator sometimes and I'm sure it will run much faster.
Thursday, February 4, 2016
Week 4 Entry
Last week we talked about a new abstract
data type that I have not studied before in high school – the stack data type.
At first I was confused about why do we use something like stack when we have
list. Aren’t lists more convenient to use? For example, the list class already
contained many useful functions – indexing, finding value etc. But as the
lecture went on I realized in some cases, list is actually a “overkill”, and
those useful functions just became a heavy load in the memory. By using stack,
we can effectively reduce memory usage thus increase the efficiency of the
program. In general, this is probably the most interesting concept I have heard
so far.
Subscribe to:
Posts (Atom)