Swift Algorithm Club: January Digest

Check out what’s been happening in January with the Swift Algorithm Club! By Kelvin Lau.

Save for later
Share

The Swift Algorithm Club is an open source project to implement popular algorithms and data structures in Swift.

We thought it would be useful to periodically give a status update with how things are going with the project.

Here’s our first update for 2017!

New Co-Maintainer

Our previous co-maintainer, Chris Pilcher, is leaving us due to new responsibilities in his life. Chris has been responsible for adding Swift lint, our CI integration, blog posts, and countless reviews and merge requests since he’s been on board. Thanks Chris, and I’m sure we’ll see him around in the repo, as he’s a contributor as well.

Last week, we had a call for applications for a new co-maintainer, and the response has been tremendous. So far we’ve got 22 really passionate applicants, ranging from talented students to seasoned veterans. In the next few days, we plan on welcoming our new co-maintainer.

Contributions

In addition to a few dozen great fixes and minor updates from our community, we also have a couple of new contributions as well.

Dining Philosophers Problem

In computer science, the dining philosophers problem is an example problem often used in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them. It was originally formulated in 1965 by Edsger Dijkstra as a student exam exercise, presented in terms of computers competing for access to tape drive peripherals. Soon after, Tony Hoare gave the problem its present formulation. This Swift implementation is based on the Chandy/Misra solution and it uses GCD Dispatch and Semaphone on Swift. Cross platform is an example problem often used in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them.

It was originally formulated in 1965 by Edsger Dijkstra as a student exam exercise, presented in terms of computers competing for access to tape drive peripherals. Soon after, Tony Hoare gave the problem its present formulation.

Knuth-Morris-Pratt String Search

The Knuth-Morris-Pratt algorithm is considered one of the best algorithms for solving the pattern matching problem. Although in practice Boyer-Moore is usually preferred, the algorithm that we will introduce is simpler, and has the same (linear) running time.

Swift 3 Migration

Our Swift 3 migration is coming to a close. So far, 66 of the 71 algorithms have been converted to Swift 3. Migration has generally been quite straightforward – it’s just the process of:

Want to help out? It’s a great way to learn about algorithms and Swift 3 at the same time. If so, check out our Github issue and sign up!

Where To Go From Here?

The Swift Algorithm Club is always looking for new members. Whether you’re here to learn or here to contribute, we’re happy to have you around.

To learn more about the Swift Algorithm Club, check out our introductory article. We hope to see you at the club! :]