Algorithms in Objective-C