Exercicio 4.5 #
Indexing the coordinates from zero, the positions are (0, 9), (5, 6), (7, 5), (9, 0)
Equations
- Chapter4.BST1.flatcat Chapter4.BST1.Tree.null x✝ = x✝
- Chapter4.BST1.flatcat (l.node x_2 r) x✝ = Chapter4.BST1.flatcat l (x_2 :: Chapter4.BST1.flatcat r x✝)
Instances For
Equations
Instances For
def
Chapter4.BST2.partition3
{a : Type u_1}
[LT a]
[DecidableRel fun (x1 x2 : a) => x1 < x2]
[DecidableRel fun (x1 x2 : a) => x1 = x2]
(y : a)
(xs : List a)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[irreducible]
def
Chapter4.DSet.merge
{a : Type u_1}
[LT a]
[DecidableEq a]
[DecidableRel fun (x1 x2 : a) => x1 < x2]
:
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.DSet.merge [] x✝ = x✝
- Chapter4.DSet.merge x✝ [] = x✝
Instances For
def
Chapter4.DSet.union₁
{a : Type}
[LT a]
[DecidableRel fun (x1 x2 : a) => x1 < x2]
(t₁ t₂ : Set a)
:
Set a
Equations
Instances For
def
Chapter4.DSet.build
{a : Type}
[Inhabited a]
[LT a]
[DecidableRel fun (x1 x2 : a) => x1 < x2]
(xs : List a)
:
Set a
Equations
- Chapter4.DSet.build xs = Chapter4.DSet.frm 0 xs.length xs.toArray
Instances For
def
Chapter4.DSet.union₂
{a : Type}
[Inhabited a]
[LT a]
[DecidableEq a]
[DecidableRel fun (x1 x2 : a) => x1 < x2]
(t₁ t₂ : Set a)
:
Set a
Equations
Instances For
def
Chapter4.DSet.split₁
{α : Type}
[LT α]
[LE α]
[DecidableRel fun (x1 x2 : α) => x1 < x2]
[DecidableRel fun (x1 x2 : α) => x1 ≤ x2]
(x : α)
:
Equations
- Chapter4.DSet.split₁ x = Chapter4.DSet.pair Chapter4.BST2.mkTree ∘ (List.partition fun (x_1 : α) => decide (x_1 ≤ x)) ∘ Chapter4.BST2.Tree.flatten