Category Archives: Algorithms

Bellman-Ford Algorithm in Swift

      2 Comments on Bellman-Ford Algorithm in Swift

Bellman-Ford algorithm is a very versatile algorithm for finding the shortest path on an edge weighted directed graph. It differs from Dijkstra’s algorithm in that it can handle the negative cycles on the graph. In this article we’ll implement the Bellman-Ford algorithm in swift and with it conclude our journey… Read more »

Detecting Directed Cycles In Edge Weighted Digraphs

Edge weighted digraphs can be used for a large number of things. In some cases we want to know if there’s a directed cycle between the nodes (or vertices). For example, if we’re working on a scheduling app, we would be interested to know if there’s a cycle on the… Read more »

Dijkstra’s Algorithm in Swift

      2 Comments on Dijkstra’s Algorithm in Swift

Last week we’ve talked about edge weighted digraphs in swift. This week we’ll talk about a famous algorithm that’s using that data structure. Dijkstra’s algorithm is a simple and well-known algorithm for finding a shortest path between two points on a graph. In this article we’ll implement Dijkstra’s algorithm in… Read more »

Swift Sorting Algorithm

      2 Comments on Swift Sorting Algorithm

Early this year Dejan wrote an amazing article about sorting algorithms. In this article he was comparing common sorting algorithms with the swift sorting algorithm. What we could observe from his conclusion is that swift sorting algorithm is a lot faster than any other concurrent. Now that swift is open… Read more »

Binary Search Array Extension in Swift

      7 Comments on Binary Search Array Extension in Swift

There are more than a few search algorithms. Today we’ll examine one of them, the Binary Search Algorithm, and we’ll implement this algorithm using an array extension in swift. We’ll also compare the performance of this algorithm to your standard brute force search, and see how it compares. Binary Search Algorithm… Read more »

Implementing Common Sorting Algorithms in Swift

Sorting algorithms are an important feature of modern computing, and in this article we’ll examine some of the most common sorting algorithms in use today. Implementations of these algorithms will be done in swift, but they are language agnostic, and you should have on problems implementing them in a language… Read more »