I'm so close to graduation. The second project of the semester in my CS course, Data Structures, is aggravating. Maybe it's the teacher, maybe it's senioritis but, either way, I just can't get past the intricate requirements that C++ has in place for reasons, it seems, simply to frustrate me.
For example, I have a templated PRQuadTree (which is only good for one thing) and yet it must be templated. While implementing the delete method I realize that we find the item to be deleted using the coordinates, but we only really want to delete one element from the vector stored by the element in the tree. In a normal data structure I would just delete the node but now I have to do a song and dance to make sure the offset is in the vector and delete it, if it is empty then delete the node. This violates the templating quite a bit. The only way I can get away with it is by implementing some backwards-ass method in the comparator that every element to be inserted would then have to implement as well in order to use this PRQuadTree.
Grrr...
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment