This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main extends App { | |
case class Vertice(valor: Int, esquerda: Option[Vertice], direita: Option[Vertice]) { | |
override def toString = valor.toString | |
} | |
val v1 = Vertice(10,None,None) | |
val v3 = Vertice(30,None,None) | |
val v2 = Vertice(5,Some(v3),None) | |
val root = Vertice(3,Some(v1), Some(v2)) | |
def imprimeGrafo(vertice: Vertice): Unit = { |
NewerOlder