Skip to content

Instantly share code, notes, and snippets.

View trilliwon's full-sized avatar
🎯
Focusing

WonJo trilliwon

🎯
Focusing
View GitHub Profile
var countLabel: UILabel = {
$0.textAlignment = .center
$0.font = Font.SfCompactDisplay.medium.withSize(18)
$0.textColor = .black
$0.translatesAutoresizingMaskIntoConstraints = false
return $0
}(UILabel())
//: [Previous](@previous)
/*:
# Selection Sort
### Runtime:
- Best: O(N^2)
- Average: O(N^2)
- Worst: O(N^2)
//: [Previous](@previous)
/*:
# Quick Sort
### Runtime:
- Best: O(NlogN)
- Average: O(NlogN)
//: [Previous](@previous)
/*:
# Merge Sort
### Runtime:
- Best: O(NlogN)
- Average: O(NlogN)
//: [Previous](@previous)
/*:
# Insertion Sort
### Runtime:
- Best: O(N)
- Average: O(N^2)
- Worst: O(N^2)
//: [Previous](@previous)
/*:
# Counting Sort
### Runtime:
- Best: O(N + K)
- Average: O(N + K)
//: [Previous](@previous)
/*:
# Bucket Sort
### Runtime:
- Best: O(N + K)
- Average: O(N + K)
//: [Previous](@previous)
/*:
# Bubble Sort
### Runtime:
- Best: O(N)
- Average: O(N^2)
- Worst: O(N^2)
public extension OperationQueue {
static var serial: OperationQueue {
let queue = OperationQueue()
queue.maxConcurrentOperationCount = 1
return queue
}
}
@dynamicMemberLookup
public struct Builder<Base> {
public var build: () -> Base
public init(_ build: @escaping () -> Base) {
self.build = build
}
public init(_ base: Base) {