objective-c code for CTCI examples