Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adrfer/Sort
Alluring experiments with sorting algorithms, sort of
https://github.com/adrfer/Sort
playground swift
Last synced: 2 months ago
JSON representation
Alluring experiments with sorting algorithms, sort of
- Host: GitHub
- URL: https://github.com/adrfer/Sort
- Owner: adrfer
- License: wtfpl
- Created: 2015-11-29T23:46:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-28T13:26:56.000Z (about 7 years ago)
- Last Synced: 2024-01-28T08:08:09.713Z (5 months ago)
- Topics: playground, swift
- Language: Swift
- Homepage:
- Size: 334 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- Awesome-Swift-Playgrounds - Sorting Experiments - Alluring experiments with sorting algorithms in Swift, sort of. (Theoretical Computer Science / Algorithms and Data Structures)
README
# Sort
Alluring experiments with sorting algorithms, sort of.Tested against `Swift 3` and `Xcode 8`.
##
### Welcome to the Sort Playground!This is about exploring alternative implementations of different sorting techniques written in [Swift](http://swift.org). To move from disarray to order when managing collections of data, some variations of these sorting algorithms are provided, starting with a classic implementation that is then forged over and over until it becomes more idiomatic, or simply, more Swift-y.
Indulge yourself with the following takes:
- **The Classic:** a die-hard style, rooted in tradition, in all its imperative glory
- **The Swift-ish:** a sligthly more modern take on the classic, but still not quite quaint enough
- **The Swiftest:** a nifty approach that attempts to tap into the most powerful features of the language yet
- **The Generic:** a play on the swiftest version, but elevated to a type-agnostic nirvana status
- **The Functional:** a quirky take that unleashes some of the neat declarative aspects of the language
- **The Bonus:** a twist on both the swift-ish and generic versions that takes an ordering predicateAlso, a few test cases covering some initial conditions are included:
- Sorted
- Nearly Sorted
- Reversed
- ShuffledI know, I know... Talk is cheap, show me the code, right?
##
### Table of Contents- [Bubble Sort](https://github.com/adrfer/Sort/blob/master/Sort.playground/Pages/Bubble%20Sort.xcplaygroundpage/Contents.swift)
- [Insertion Sort](https://github.com/adrfer/Sort/blob/master/Sort.playground/Pages/Insertion%20Sort.xcplaygroundpage/Contents.swift)
- [Merge Sort](https://github.com/adrfer/Sort/blob/master/Sort.playground/Pages/Merge%20Sort.xcplaygroundpage/Contents.swift)
- [Quick Sort](https://github.com/adrfer/Sort/blob/master/Sort.playground/Pages/Quick%20Sort.xcplaygroundpage/Contents.swift)
- [Selection Sort](https://github.com/adrfer/Sort/blob/master/Sort.playground/Pages/Selection%20Sort.xcplaygroundpage/Contents.swift)##
**Note:** Remember, the focus of this playground is experimentation, learning, and having fun. Do not expect any crazy award-winning performant code ahead, ok?
##
Feel free to [ping me](https://twitter.com/_adrfer) on Twitter.