SwiftStructures alternatives and similar libraries
Based on the "Data Structures / Algorithms" category.
Alternatively, view SwiftStructures alternatives based on common mentions on social networks and blogs.
-
Dollar
A functional tool-belt for Swift Language similar to Lo-Dash or Underscore.js in Javascript -
Result
Swift type modelling the success/failure of arbitrary operations. -
DeepDiff
🦀Amazingly incredible extraordinary lightning fast diffing in Swift -
Algorithm
Algorithm is a library of tools that is used to create intelligent applications. -
Differ
Swift library to generate differences and patches between collections. -
KeyPathKit
KeyPathKit is a library that provides the standard functions to manipulate data along with a call-syntax that relies on typed keypaths to make the call sites as short and clean as possible. -
SwiftPriorityQueue
A Generic Priority Queue in Pure Swift -
Buffer
Swift μ-framework for efficient array diffs and datasource adapters. -
BinaryKit
💾🔍🧮 BinaryKit helps you to break down binary data into bits and bytes, easily access specific parts and write data to binary. -
Differific
:fuelpump: Differific - a fast and convenient diffing framework. -
Brick
:droplet: A generic view model for both basic and complex scenarios -
AnyObjectConvertible
Convert your own struct/enum to AnyObject easily. -
HAMT (for Swift)
An implementation of HAMT data-structure in Swift -
RandMyMod
RandMyMod base on your own struct or class create one or a set of instance, which the variable's value in the instance is automatic randomized. -
OneWaySynchronizer
The simplest abstraction to synchronize local data with remote source. For iOS, wirtten in swift.
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SwiftStructures or a related project?
README
Swift Structures
This project provides a framework for commonly used data structures and algorithms written in a new iOS development language called Swift. While details of many algorithms exists on Wikipedia, these implementations are often written as pseudocode, or are expressed in C or C++. With Swift now officially released, its general syntax should be familiar enough for most programmers to understand.
Audience
As a developer, you should already be familiar with the basics of programming. Beyond algorithms, this project also aims to provide an alternative for learning the basics of Swift. This includes implementations of many Swift-specific features such as optionals, extensions, protocols and generics. Beyond Swift, audiences should be familiar with Singleton and Factory design patterns along with sets, arrays and dictionaries.
Features
The project features code-level examples for the following items:
- Linked Lists
- Binary Search
- Insertion Sort
- Bubble Sort
- Selection Sort
- Quick Sort
- Binary Search Trees
- Tree Balancing - Rotations
- Stacks
- Queues
- Heaps & Heapsort Operations
- Hash Tables
- Tries
- Graphs
- Dijkstra's Shortest Path
- Depth-First Search
- Breadth-First Search
- Protocol Extensions
- Enumerations
- Fibonacci Numbers
- Generics
- Dyanmic Programming
- Closures
The Book
Now in its 4th edition and supporting Swift 4.2, the The Swift Algorithms Book features code and color illustrations that benefits students and professionals. As a collaborative open-source effort, I also welcome feedback and contribution from others.
Example
//bfs traversal with inout closure function
func traverse(_ startingv: Vertex, formula: (_ node: inout Vertex) -> ()) {
//establish a new queue
let graphQueue: Queue<Vertex> = Queue<Vertex>()
//queue a starting vertex
graphQueue.enQueue(startingv)
while !graphQueue.isEmpty() {
//traverse the next queued vertex - Swift 4.0
//var vitem: Vertex! = graphQueue.deQueue()
//traverse the next queued vertex
guard var vitem = graphQueue.deQueue() else {
break
}
//add unvisited vertices to the queue
for e in vitem.neighbors {
if e.neighbor.visited == false {
print("adding vertex: \(e.neighbor.key) to queue..")
graphQueue.enQueue(e.neighbor)
}
}
//invoke formula
formula(&vitem)
} //end while
print("graph traversal complete..")
}
Getting Started
Swift Structures has been optimized for Swift 4.2 (e.g., Xcode 10.0) or later. The directories are organized as follows:
- Source - Code for all Swift data structures, algorithms and source extensions
- Example - An empty iOS single-view application template
- SwiftTests - Unit tests with XCTest Framework
Usage
Individuals are welcome to use the code with commercial and open-source projects. As a courtesy, please provide attribution to waynewbishop.com. For more information, review the complete license agreement.
Branches
- master - The production branch. Clone or fork this repository for the latest copy
- develop - The active Swift 4.2 development branch. Swift 4.2 pull requests should be directed to this branch
Other Projects
- EKAlgorithms - A set of computer exercises implemented in Objective-C
- Algorithms - A playground for common questions implemented in Ruby
Questions
Have a question? Feel free to contact me on Twitter or online.
*Note that all licence references and agreements mentioned in the SwiftStructures README section above
are relevant to that project's source code only.