I did exercise 1-4 before exercise 1-3 because you sort of need 1-4 to do 1-3 properly.
A quick explanation from the header docs:
»Read More
I did exercise 1-4 before exercise 1-3 because you sort of need 1-4 to do 1-3 properly.
A quick explanation from the header docs:
»Read More
“How would you implement bit vectors using bitwise operations?”
My solution in C++ is here: BitVector.h
BitVector.cc
With syntax highlighting: BitVector.h BitVector.cc
“If memory were not scarce, how would you implement sort in a language with libraries for representing and sorting sets?â€
My solution is here, written in Python. I made this one a bit more complicated than it needed to be, but I found the extra conditions to make things a bit more fun and interesting.
With syntax highlighting, courtesy of my lil cousin: first.py.
As I’ve explained on this page, I have begun a quest to come up with solutions to all of the exercises in Bentley’s Programming Pearls (2nd edition). Ideally I’ll get some feedback on these as I go along, but I’m not expecting much here. To facilitate this, I’ll be posting each solution in its own blog post so that people who stumble across them (looking for homework answers, perhaps) will be able to comment if they so choose.
I’ve also got a bunch of book reviews that I want to crank out, as well as a very short essay describing some of the changes that have occurred in my thinking over the last year or so. (I can hear the jaws in the audience cracking already.)
Stay tuned!