#! test
import jgraspvex.BinaryTreeK
import jgraspvex.BinaryTreeNodeK

fun main(args: Array<String>) {

    // Unsorted test values.
    val values = intArrayOf(5, 9, 12, 3, 22, 1, 17, 4, 8, 11)

    // Sorted test values.
    val sortedValues = intArrayOf(1, 3, 4, 5, 8, 9, 11, 12, 17, 22)


    while (true) {
        val bt = BinaryTreeK(BinaryTreeNodeK(0))
        for (i in values.indices) {
            println("Add: " + values[i])
            bt.add(Integer.valueOf(values[i]))
        }
        for (i in sortedValues.indices) {
            println("Remove: " + sortedValues[i])
            bt.remove(Integer.valueOf(sortedValues[i]))
        }
    }
}
