Common math and computer science algorithms in Objective-C