A Generic Priority Queue in Pure Swift
SwiftPriorityQueue
What is SwiftPriorityQueue?
SwiftPriorityQueue is a pure Swift (no Cocoa) implementation of a generic priority queue data structure, appropriate for use on all platforms (macOS, iOS, Linux, etc.) where Swift is supported. It features a straightforward interface and can be used with any type that implements Comparable. It utilizes comparisons between elements rather than separate numeric priorities to determine order.
Internally, SwiftPriorityQueue uses a classic binary heap, resulting in O(lg n) pushes and pops. It includes in-source documentation, an A* based example maze solving program (for macOS), and unit tests (pull requests are welcome for additional unit tests in particular).
Features:
- Easy-to-use method interface
- Small, self contained, pure Swift code base
- Classic binary heap implementation with O(lg n) pushes and pops
- Iterable through standard Swift for…in loops (implements Sequence and IteratorProtocol)
- In-source documentation
- A fun maze solving A* based example program
Overview
- Pricing: Free
- Resource Link: https://github.com/davecom/SwiftPriorityQueue
- Resource Maker: David Kopec
- Mobile Platform Destination: iOS Apps
- Mobile Platform Support: Native iOS
- Programming Languages: Swift
- CocoaPods: SwiftPriorityQueue
Related resources
MongoKitten
Native MongoDB driver for Swift, written in Swift
AnimatedGIFImageSerialization
Complete Animated GIF Support for iOS, with Functions, NSJSONSerialization-style Class
InfoView
Swift based simple information view with pointed arrow