Wednesday, March 19, 2014

Week 10

How's it going guysss. I hope everything is on the right track for you guys. I can't believe that it is week 10 already and my journey in CSC148 is slowly coming to an end. I didn't even realized that time just passed by this fast. I think I really will be missing my time in CSC148, except the all-night writing programming part. Yes, Part 2 of Assignment 2 is due tomorrow. I think I'll be lucky if I can get more than 3 hours of sleep today. Since the professor spent quite a lot of time in talking about the assignment in class so I want to share with you guys about it. 

In part 2 of assignment two, we have to implement four functions for the regex tree. The four functions are is_regex, all_regex_permutations, regex_match and build_regex_tree. Among the four functions, I think is_regex is the hardest and takes me and my partner the longest to program it. Again since the assignment is due tomorrow, I won't reveal too much of our program here. But what we have to do is that we need to write a sub function to first isolate the deepest regex. By that I mean the first regex in the tree. If it's a bar ('|') or a dot ('.'), we'll split its children into two regexes. Then repeat the process again until the last note of the regex. The hardest part of the function is to figure out the right method to identify the deepest regex. Once we got that figure out, this function is basically done. Other functions can be rebuilt around this method. Therefore, the method is almost 40% of part 2. I guess this is the fun part of computer science. Sometimes your program only needs one important method. But that method is never that easy for you to figure it out. It may take you hours, or days or even weeks. Once you got the solved, you don't really have to worry about the rest of your program.

In this week's lecture, our professor also introduced different sorting algorithms. Using a list of random numbers, we could see that different sorting algorithm perform differently. Some finished the sorting really quick and some may take a longer time to finish the sorting. This is a very important topic to learn because learning the concept of this can really help me with the concept of efficiency. And the efficiency of the program is something that a computer scientist should always be thinking about. 

So far in CSC148, I'm still enjoying this course. Although the midterms are really tough, I didn't lose interest for this course because of that. I have friends who dropped the course after realizing that the midterm wasn't as easy as they thought. I like CSC148 because the challenge never ends and I can always learn something every time when I program. And learning how to program is like learning a new language, a language that let us to communicate with other computer programmers. I think this is pretty cool. I'll keep working hard on my recursion since it is the hardest part in this course and also my weakest part.

I guess that'll be all for this week. I need to get back to work or I won't be able to get any sleep tonight. See you guys later !!!!


No comments:

Post a Comment