Compare commits
2 Commits
35ca270476
...
eaae27f043
Author | SHA1 | Date |
---|---|---|
Nathan van Doorn | eaae27f043 | |
Nathan van Doorn | 086e98e532 |
|
@ -54,7 +54,7 @@ upFromThen from (suc then) = from ∷ upFromThen (suc from) then
|
||||||
upTo : ℕ → List ℕ
|
upTo : ℕ → List ℕ
|
||||||
upTo = upFromThen 0
|
upTo = upFromThen 0
|
||||||
|
|
||||||
open import SplayHeap (On.totalOrder ≤-totalOrder (proj₂ {A = ℕ})) public
|
open import SplayHeap (On.totalOrder ≤-totalOrder (proj₂ {A = ℕ}))
|
||||||
|
|
||||||
insertPrime : ℕ → Heap → Heap
|
insertPrime : ℕ → Heap → Heap
|
||||||
insertPrime p table = insert (p , p * p) table
|
insertPrime p table = insert (p , p * p) table
|
||||||
|
|
|
@ -24,9 +24,10 @@ open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong; modu
|
||||||
open import Relation.Nullary.Construct.Add.Extrema
|
open import Relation.Nullary.Construct.Add.Extrema
|
||||||
open import Relation.Nullary.Decidable.Core
|
open import Relation.Nullary.Decidable.Core
|
||||||
|
|
||||||
data Tree (l u : Carrier ±) : Set (c ⊔ ℓ₂) where
|
private
|
||||||
leaf : .(l ≤± u) → Tree l u
|
data Tree (l u : Carrier ±) : Set (c ⊔ ℓ₂) where
|
||||||
node : (x : Carrier) → Tree l [ x ] → Tree [ x ] u → Tree l u
|
leaf : .(l ≤± u) → Tree l u
|
||||||
|
node : (x : Carrier) → Tree l [ x ] → Tree [ x ] u → Tree l u
|
||||||
|
|
||||||
Heap : Set (c ⊔ ℓ₂)
|
Heap : Set (c ⊔ ℓ₂)
|
||||||
Heap = Tree ⊥± ⊤±
|
Heap = Tree ⊥± ⊤±
|
||||||
|
|
Loading…
Reference in New Issue