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 use GCD Dispatch and Semaphone on Swift cross platform” target=”_blank”>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 use GCD Dispatch and Semaphone on Swift cross platform
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:
- Making sure the playground compiles correctly
- Making sure
README.md
file reflects the updated playground - Incorporate the new Swift API design guidelines in terms of naming of methods
- Check out our new Swift 3 Style guide
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! :]
The post Swift Algorithm Club: January Digest appeared first on Ray Wenderlich.