Computer Science Algorithms implemented in Swift