CollectionsKit gives the programmer access to collection data structures.
Install Carthage.
$ cd ~/Path/To/Your/Project
$ echo 'github "lucaslouca/CollectionsKit"' > Cartfile
$ carthage update --platform iOS
- Open your Xcode project
- Select your target and choose the General tab at the top, and scroll down to the Embedded Binaries section at the bottom
- In Finder navigate to ~/Path/To/Your/Project/Build/iOS/ and drag CollectionsKit.framework into the Embedded Binaries section in Xcode
import CollectionsKit
An implementation of a Fibonacci heap data structure for priority queue operations.
var heap = LLUFibonacciHeap<Int>(>)
heap.enqueue(1)
heap.enqueue(2)
heap.enqueue(3)
heap.enqueue(4)
heap.poll()
An implementation of a Queue data structure for queue operations.
var queue = LLUQueue<Int>()
queue.enqueue(1)
queue.enqueue(2)
queue.enqueue(3)
queue.enqueue(4)
queue.poll()
Class representing a grid, where elements can be accessed using [x,y]
subscript syntax.
var grid = LLUGrid<Bool>(rows: 3, columns: 10, defaultValue: false)
grid[1,1] = true
grid[2,0] = false
An implementation of a Stack data structure for stack operations.
var stack = LLUStack<Int>()
stack.push(1)
stack.push(2)
stack.pop()
An implementation of a Trie data structure.
var trie = LLUTrie()
trie.add("tall")
trie.add("taxi")
trie.wordsWithPrefix("ta") // ["taxi", "tall"]
An implementation of a directed graph data structure.
var graph = LLUDirectedGraph<Int>()
graph.addNode(1)
graph.addNode(2)
graph.addNode(3)
try! graph.addEdge(1, destination: 2)
try! graph.addEdge(2, destination: 3)
let neighbors = try! graph.neighborsOf(1)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>