CollectionsKit gives the programmer access to collection data structures.
Integrate CollectionsKit into your project
$ cd ~/Path/To/Your/Project $ echo 'github "lucaslouca/CollectionsKit"' > Cartfile $ carthage update --platform iOS
Link Framework to your Xcode project
- 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 the Framework
An implementation of a Fibonacci heap data structure for priority queue operations.
Create a new heap
var heap = LLUFibonacciHeap<Int>(>)
heap.enqueue(1) heap.enqueue(2) heap.enqueue(3) heap.enqueue(4)
An implementation of a Queue data structure for queue operations.
Create a new queue
var queue = LLUQueue<Int>()
queue.enqueue(1) queue.enqueue(2) queue.enqueue(3) queue.enqueue(4)
Class representing a grid, where elements can be accessed using
[x,y] subscript syntax.
Create a new grid
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.
Create a new stack
var stack = LLUStack<Int>()
Push items onto the stack
An implementation of a Trie data structure.
Create a new trie
var trie = LLUTrie()
Search words by prefix
trie.wordsWithPrefix("ta") // ["taxi", "tall"]
An implementation of a directed graph data structure.
Create a new graph
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/>