Latest 1.1.1
Homepage https://github.com/Meniny/SortAlgorithm
License MIT
Platforms ios 8.0, tvos 9.0, watchos 2.0, osx 10.9, requires ARC




VersionAuthorBuild PassingSwift
PlatformsMIT
CocoapodsCarthageSPM

Introduction

What’s this?

SortAlgorithm is a Swift array sort algorithm framework.

Requirements

  • iOS 8.0+
  • tvOS 9.0+
  • macOS 10.9+
  • watchOS 2.0+
  • Xcode 9 with Swift 4

Installation

CocoaPods

pod 'SortAlgorithm'

Contribution

You are welcome to fork and submit pull requests.

License

SortAlgorithm is open-sourced software, licensed under the MIT license.

Sample

// Randome Array
let original = [Int].init(repeating: 0, count: 5000).map { $0 + Int(arc4random_uniform(5000)) }
let closure: Array<Int>.SortingCompareClosure = { (l, r) -> Bool in
    return l < r
}
// Now sort
print("Bubble: n(original.bubbleSort(by: closure))")
print("nn======nn")
print("Insertion: n(original.insertionSort(by: closure))")
print("nn======nn")
print("Merge: n(original.mergeSort(by: closure))")
print("nn======nn")
print("Quick: n(original.quickSort(by: closure))")
print("nn======nn")
print("Counting: n(original.countingSort())")
print("nn======nn")
print("Heap: n(original.heapSort(by: closure))")

Latest podspec

{
    "name": "SortAlgorithm",
    "version": "1.1.1",
    "summary": "Swift array sort algorithm",
    "homepage": "https://github.com/Meniny/SortAlgorithm",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Elias Abel",
    "source": {
        "git": "https://github.com/Meniny/SortAlgorithm.git",
        "tag": "1.1.1"
    },
    "social_media_url": "https://meniny.cn/",
    "source_files": "SortAlgorithm/**/*.swift",
    "requires_arc": true,
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0",
        "watchos": "2.0",
        "osx": "10.9"
    },
    "description": "SortAlgorithm is a Swift array sort algorithm framework.",
    "module_name": "SortAlgorithm",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This