AbstractBinaryTree

com.phasmidsoftware.lascala.tree.AbstractBinaryTree
See theAbstractBinaryTree companion class

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def compare[A : Ordering](anL: Node[A], anR: Node[A]): Seq[Int]

Determine whether all of the nodes on the left are ordered before all the nodes on the right

Determine whether all of the nodes on the left are ordered before all the nodes on the right

Type parameters

A

the underlying type of the nodes and comparisons

Value parameters

anL

the left-node

anR

the right-node

Attributes

Returns

true if the proposition is proven

def compare[A : Ordering](ans: NodeSeq[A], bns: NodeSeq[A]): Seq[Int]

Determine whether the value on the left is ordered before all the nodes on the right

Determine whether the value on the left is ordered before all the nodes on the right

NOTE: this is recursive

Type parameters

A

the underlying type of the nodes and comparisons

Value parameters

ans

the left-node-sequence

bns

the right-node-sequence

Attributes

Returns

true if the proposition is proven

def compare[A : Ordering](an: Node[A], bns: NodeSeq[A]): Seq[Int]

Determine whether the value on the left is ordered before all the nodes on the right

Determine whether the value on the left is ordered before all the nodes on the right

NOTE: this is recursive

Type parameters

A

the underlying type of the nodes and comparisons

Value parameters

an

the left-node

bns

the right-node-sequence

Attributes

Returns

true if the proposition is proven

def compare[A : Ordering](a: A, an: Node[A]): Seq[Int]

Determine whether the value on the left is ordered before all the nodes on the right

Determine whether the value on the left is ordered before all the nodes on the right

NOTE: this is recursive

Type parameters

A

the underlying type of the nodes and comparisons

Value parameters

a

the left-value

an

the right-node

Attributes

Returns

true if the proposition is proven

def compare[A : Ordering](a: A, as: NodeSeq[A]): Seq[Int]

Determine whether the value on the left is ordered before all the nodes on the right

Determine whether the value on the left is ordered before all the nodes on the right

Type parameters

A

the underlying type of the nodes and comparisons

Value parameters

a

the left-value

as

the right-iterator

Attributes

Returns

true if the proposition is proven

def compare[A : Ordering](a: A, b: A): Int

Determine whether the value on the left is ordered before the value on the right

Determine whether the value on the left is ordered before the value on the right

Type parameters

A

the underlying type of the nodes and comparisons

Value parameters

a

the left-value

b

the right-value

Attributes

Returns

-1 if proposition is true; 0 if they are equal; 1 if the proposition if false

def isOrdered[A : Ordering](a: Node[A], b: Node[A]): Boolean

Method to determine if node a compares as less than node b

Method to determine if node a compares as less than node b

Type parameters

A

the underlying node type

Value parameters

a

node a

b

node b

Attributes

Returns

true if node a compares as less than node b

def isOrdered(is: Seq[Int]): Maybe

Given a sequence of comparison values, determine if the result is true, false or maybe.

Given a sequence of comparison values, determine if the result is true, false or maybe.

Value parameters

is

the comparison values as a sequence of Ints (either -1, 0, or 1)

Attributes

Returns

Some(true) if all the values are -1, Some(false) if all the values are +1, otherwise None.

def isOverlap[A : Ordering](n1: Node[A], n2: Node[A]): Boolean

method to determine if there is an overlap between the values of tree n1 and tree n2

method to determine if there is an overlap between the values of tree n1 and tree n2

Type parameters

A

the underlying tree type

Value parameters

n1

the first tree (order is not important)

n2

the second tree

Attributes

Returns

true if there is an overlap of values, that's to say, the values cannot be completely separated.

def isOverlap[A : Ordering](a: A, n: Node[A]): Boolean

method to determine if there is an overlap between a value a and the values of tree n

method to determine if there is an overlap between a value a and the values of tree n

Type parameters

A

the underlying tree type

Value parameters

a

the value to compare

n

the tree

Attributes

Returns

true if there is an overlap of values, that's to say, the values cannot be completely separated.

def unapply[A](n: Node[A]): Option[(Option[A], Node[A], Node[A])]

Extractor for use in pattern matching

Extractor for use in pattern matching

Type parameters

A

the tree type

Value parameters

t

the tree

Attributes

Returns

an optional tuple of two children