Objective C Algorithm examples