Custom binary tree data alike in Scala