Sunday, August 2, 2009

Week 8

The week had been full of design making decisions, and most importantly regrets and realizations. I have been working with my partner on the project 7. The project is about implementing a Deque, that would imitate most of the functionality of the standard library's deque (std::deque). We started off with constructors, and tested our deque side by side with the standard deque. Happy with our results, we jumped into coding the methods -- insert, erase, push_front, push_back, etc. Compiling the program without any tests didn't give us any errors/warnings and was a motivation in itself. The realization time started as we started to write the test cases for these methods. Some would result into segfault, and for some the assertions would fail; and some wouldn't even compile. Yet, withstanding all the errors, and resolving those we had our "Deque.h" ready with all of our tests passing. The time was 6:00p on a Sunday (today).

Something struck on us suddenly, the motif behind implementing a deque; shouldn't it have an amortized constant time complexity for push_front() and push_back(). But too late to realize, that we had implemented a vector :(. A few minutes ago I was thinking of all the good stuff I would had for the dinner, and a few minutes later... I could think nothing except the program. But I realized, that some times (or most of the time in my case) when under pressure, brain functions better and productively (though, often it turns into a numb state). And so happened with us, the idea had to click (which hadn't for the whole week) and we had the real deque implemented. Thanks to the partnership again!

No comments:

Post a Comment