Skip to content

Instantly share code, notes, and snippets.

@GuanshanLiu
Last active September 29, 2018 12:21
Show Gist options
  • Save GuanshanLiu/85675eafbc23dedb950026aecb137cf1 to your computer and use it in GitHub Desktop.
Save GuanshanLiu/85675eafbc23dedb950026aecb137cf1 to your computer and use it in GitHub Desktop.
public struct Heap<Element: Equatable> {
private var elements = [Element]()
private let sort: (Element, Element) -> Bool
public init(sort: @escaping (Element, Element) -> Bool) {
self.sort = sort
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment