Skip to content

Instantly share code, notes, and snippets.

View kalub92's full-sized avatar

Caleb Stultz kalub92

View GitHub Profile
struct MinHeap {
var items: [Int] = []
}
struct MinHeap {
var items: [Int] = []
//Get Index
private func getLeftChildIndex(_ parentIndex: Int) -> Int {
return 2 * parentIndex + 1
}
private func getRightChildIndex(_ parentIndex: Int) -> Int {
return 2 * parentIndex + 2
}