Objective-C algorithms