All Projects → mauriciosantos → Buckets Swift

mauriciosantos / Buckets Swift

Licence: mit
Swift Collection Data Structures Library

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Buckets Swift

Data Structures
A collection of powerful data structures
Stars: ✭ 2,534 (+2290.57%)
Mutual labels:  graph, stack, trie, priority-queue, queue
Cracking The Coding Interview
Solutions for Cracking the Coding Interview - 6th Edition
Stars: ✭ 35 (-66.98%)
Mutual labels:  graph, matrix, stack, queue
Coding Interview Gym
leetcode.com , algoexpert.io solutions in python and swift
Stars: ✭ 451 (+325.47%)
Mutual labels:  graph, stack, trie, queue
Java Ds Algorithms
Data Structures and Algorithms in Java
Stars: ✭ 125 (+17.92%)
Mutual labels:  graph, matrix, stack, trie
Leetcode
High-quality LeetCode solutions
Stars: ✭ 178 (+67.92%)
Mutual labels:  graph, stack, trie, queue
DEPRECATED-data-structures
A collection of powerful data structures
Stars: ✭ 2,648 (+2398.11%)
Mutual labels:  stack, queue, trie, priority-queue
Algo Tree
Algo-Tree is a collection of Algorithms and data structures which are fundamentals to efficient code and good software design. Creating and designing excellent algorithms is required for being an exemplary programmer. It contains solutions in various languages such as C++, Python and Java.
Stars: ✭ 166 (+56.6%)
Mutual labels:  graph, stack, trie, queue
Javascript Datastructures Algorithms
📚 collection of JavaScript and TypeScript data structures and algorithms for education purposes. Source code bundle of JavaScript algorithms and data structures book
Stars: ✭ 3,221 (+2938.68%)
Mutual labels:  graph, stack, priority-queue, queue
Libgenerics
libgenerics is a minimalistic and generic library for C basic data structures.
Stars: ✭ 42 (-60.38%)
Mutual labels:  stack, trie, priority-queue, queue
Xmlmapper
A simple way to map XML to Objects written in Swift
Stars: ✭ 90 (-15.09%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Bfkit Swift
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.
Stars: ✭ 963 (+808.49%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Freedom
The Freedom to Open URLs in Third-Party Browsers on iOS with Custom UIActivity Subclasses.
Stars: ✭ 85 (-19.81%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-70.75%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Preferences
⚙ Add a preferences window to your macOS app in minutes
Stars: ✭ 898 (+747.17%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Statusalert
Display Apple system-like self-hiding status alerts. It is well suited for notifying user without interrupting user flow in iOS-like way.
Stars: ✭ 809 (+663.21%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Fontblaster
Programmatically load custom fonts into your iOS and tvOS app.
Stars: ✭ 1,000 (+843.4%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Sketchkit
A lightweight auto-layout DSL library for iOS & tvOS.
Stars: ✭ 40 (-62.26%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Defaults
Swifty and modern UserDefaults
Stars: ✭ 734 (+592.45%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Sica
🦌 Simple Interface Core Animation. Run type-safe animation sequencially or parallelly
Stars: ✭ 980 (+824.53%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Wstagsfield
An iOS text field that represents tags, hashtags, tokens in general.
Stars: ✭ 1,013 (+855.66%)
Mutual labels:  cocoapods, carthage, swift-package-manager

Buckets

Build Status CocoaPods Compatible Carthage Compatible Platform

Swift Collections Library

Buckets is a complete, tested and documented collections library for swift.

Requirements

Swift 3.0+ platforms such as:

Linux/iOS 9.0+/MacOS 10.10+/watchOS 2.0+/tvOS 9.0+

Included collections

Setup

CocoaPods

CocoaPods is a dependency manager for Swift and Objective-C projects. The latest version adds support for embedded frameworks. You can install it with the following command:

$ gem install cocoapods

To integrate Buckets into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target 'TargetName' do
  pod 'Buckets', '~> 2.0'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate Buckets into your Xcode project using Carthage, specify it in your Cartfile:

github "mauriciosantos/Buckets-Swift" ~> 2.0

Swift Package Manager

See Swift Package Manager documentation

Manually

You can also integrate Buckets into your Xcode project manually:

  • Download the latest release and unzip it in your project's folder.
  • Open the Buckets folder, and drag Buckets.xcodeproj into the file navigator of your app project. This means inside your project, not at the top level.
  • Ensure that the deployment target of Buckets.framework matches that of the application target.
  • Open your project's "Build Phases" panel. Expand the "Target Dependencies" group, and add Buckets.framework.
  • Click on the + button at the top left of the panel and select "New Copy Files Phase". Set the "Destination" to "Frameworks", and add Buckets.framework. There are 4 versions for each platform. Select the right one.

Usage

All collection types are implemented as structures. This means they are copied when they are assigned to a new constant or variable, or when they are passed to a function or method.

You shouldn't worry about copying structs:

The behavior you see in your code will always be as if a copy took place. However, Swift only performs an actual copy behind the scenes when it is absolutely necessary to do so. Swift manages all value copying to ensure optimal performance, and you should not avoid assignment to try to preempt this optimization.

Buckets collection types are optimized in the same way.

Walkthrough

import Buckets

var queue = Queue<String>()
queue.enqueue("first")
queue.enqueue("last")
queue.dequeue() // "first"

var deque = Deque<String>()
deque.enqueueLast("last")
deque.enqueueFirst("first")
deque.dequeueFirst() // "first"

var stack = Stack<String>()
stack.push("first")
stack.push("last")
stack.pop() // "last"

var pQueue = PriorityQueue<Int>(sortedBy: <)
pQueue.enqueue(3)
pQueue.enqueue(1)
pQueue.enqueue(2)
pQueue.dequeue() // 1

var multiset = Multiset<String>()
multiset.insert("a")
multiset.insert("b")
multiset.insert("a")
multiset.distinctCount // 2
multiset.count("a") // 2

var multimap = Multimap<String, Int>()
multimap.insertValue(1, forKey: "a")
multimap.insertValue(5, forKey: "a")
multimap["a"] // [1, 5]

var bimap = Bimap<String, Int>()
bimap[key: "a"] = 1
bimap[value: 3] = "b"
bimap[value: 1] // "a"
bimap[key: "b"] // 3

var graph = Graph<String, Int>()
graph["Boston", "NY"] = 5
graph["NY", "Miami"] = 5
graph.pathFrom("Boston", to: "Miami") // ["Boston", "NY", "Miami"]

var matrix: Matrix<Double> = [[1,2,3], [4,5,6]]
matrix[1, 0] = 5
matrix - [[1,0,1], [1,0,1]] // [[0,2,2],[4,5,5]]

var bitArray: BitArray = [true, false]
bitArray.append(true)
bitArray.cardinality // 2

var circArray = CircularArray<Int>()
circArray.append(1)
circArray.prepend(2)
circArray.first // 2

var bFilter = BloomFilter<String>(expectedCount: 100)
bFilter.insert("a")
bFilter.contains("a") // true

Read the documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].