This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var countLabel: UILabel = { | |
$0.textAlignment = .center | |
$0.font = Font.SfCompactDisplay.medium.withSize(18) | |
$0.textColor = .black | |
$0.translatesAutoresizingMaskIntoConstraints = false | |
return $0 | |
}(UILabel()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: [Previous](@previous) | |
/*: | |
# Selection Sort | |
### Runtime: | |
- Best: O(N^2) | |
- Average: O(N^2) | |
- Worst: O(N^2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: [Previous](@previous) | |
/*: | |
# Quick Sort | |
### Runtime: | |
- Best: O(NlogN) | |
- Average: O(NlogN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: [Previous](@previous) | |
/*: | |
# Merge Sort | |
### Runtime: | |
- Best: O(NlogN) | |
- Average: O(NlogN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: [Previous](@previous) | |
/*: | |
# Insertion Sort | |
### Runtime: | |
- Best: O(N) | |
- Average: O(N^2) | |
- Worst: O(N^2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: [Previous](@previous) | |
/*: | |
# Counting Sort | |
### Runtime: | |
- Best: O(N + K) | |
- Average: O(N + K) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: [Previous](@previous) | |
/*: | |
# Bucket Sort | |
### Runtime: | |
- Best: O(N + K) | |
- Average: O(N + K) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: [Previous](@previous) | |
/*: | |
# Bubble Sort | |
### Runtime: | |
- Best: O(N) | |
- Average: O(N^2) | |
- Worst: O(N^2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension OperationQueue { | |
static var serial: OperationQueue { | |
let queue = OperationQueue() | |
queue.maxConcurrentOperationCount = 1 | |
return queue | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@dynamicMemberLookup | |
public struct Builder<Base> { | |
public var build: () -> Base | |
public init(_ build: @escaping () -> Base) { | |
self.build = build | |
} | |
public init(_ base: Base) { |