Friday, March 14, 2014

Week 9

I got the busiest week ever for computer science. And until now, when I am writing this slog, there are still a bunch of stuffs that I yet completed. Let walk through everything happened this week.

In the lecture, we were talking about time complexity of different types of sorts. I know that most people would only focus on the most efficient types of sorts like selection, insertion or bubble sort. But I had a special interest in the type of sort that professor Heap called “horrible sort”. Horrible sort has running time ‘cn!’, and it is the second slowest type for sorting - according to lecture slides. I thought about it when I was in the bathroom this evening, and came up with an algorithm that I believe has time complexity of ‘cn!’. (Check out my extra post # 3)

The lab works for this week was heavy. We were asked to write just one method count_less(num) for Binary Search Tree class, which count the number of nodes that less in than num in the tree. The fun thing is that we not just had to write it once but 4 times using direct, indirect recursion and iteration. My partner and I managed to get the first three functions, which only used recursion during the lab hours. But I had no idea how to write such an iterative function that did the same thing as the recursive function since the ADT binary tree only favor recursion.

The e3 was much harder than e1 and e2. It took me a day to solve it last weekend and I thought that my codes were perfect. But when received my autotest result on Monday, it turned out that I failed ¾ of the test cases. At first, I thought there was a bug in my code but I was later informed that it was a mistake in the tester code and it was fixed. I got the second auto test this early morning, and again, another error was found, not in my code (I believe) but in the tester code. Its very annoying now since the deadline is tomorrow and I still not heard anything from the professor. I don’t know if I should to fix my code according to expected result of an invalid test case in the auto test file or keep waiting for the confirmation from the professor.

I’m suspecting that some of the test case used in auto test file was intentionally made to be invalid! Maybe, the professors just want to test how well the students understand the instruction or they may want to distract us from doing the second assignment, which due soon after e3. Who know?

Over the last few days, I have been working on the second part of assignment 2. My program so far looks promising. It ran smoothly for all of the extreme test cases that I made. Since, I already completed ¾ of the work and still have a week ahead, I feel pretty confident and hopefully it would be the one I have highest grade in!

It was everything that I want to say for this week! In week 10 Slog, I will talk in detail about the second part of this assignment in detail when the deadline for the assignment has passed.

No comments:

Post a Comment