Sunday, July 27, 2014

Week 7

Class:
This week started off with a much needed explanation of the deque project. Many of the students in the class were freaking out because after spending some time looking at the skeleton code they felt some of the code looked foreign and could use some clarification. We spent Monday walking through the STL vector and how it was implemented. This proved to be an excellent exercise as I had made sure to take lots of notes while the professor talked about every aspect of vector. The week continued as we discussed some of the other C++ data structures that used containment to get their work done. Structures like stack, queue, and priority queue are all backed by either vector, deque, or list and we explored the possible Pros and Cons of using each backing structure over the other. The week ended off with some performance boosting information on making functions faster by declaring them as structures and sending into the higher order function an instance of the lower order function.

Project:
Deque proved to be extremely challenging in the short amount of time that we had. My partner and I got to an early start over the weekend and came up with some really novel ways to approach the deque project. After stepping on toes and bashing out some early implementations of our ideas we realized we were going nowhere. Luckily in Mondays lecture the professor dropped a small hint. "Implement a stupid version of deque that uses a single resizing container and write all the methods in a way that passes the buck to just a few key methods in Deque and get that to work, then you can build the version that will give you credit." Although my partner seemed reluctant, worrying that implementing the stupid solution would take too long, I pushed ahead and made the stupid version literally in 5 hours and had it up and running. Now that I felt confident in my understanding of deque, and my partner felt confident in me, we were able to quickly push through finishing up deque together having only to rewrite just a few special methods to make the magic happen.

No comments:

Post a Comment