Skip to content

Instantly share code, notes, and snippets.

@JCSooHwanCho
JCSooHwanCho / Heap.swift
Created September 12, 2020 14:20
swift로 간단하게 구현한 힙
public struct Heap<T> {
var nodes: [T] = []
let comparer: (T,T) -> Bool
var isEmpty: Bool {
return nodes.isEmpty
}
init(comparer: @escaping (T,T) -> Bool) {
self.comparer = comparer