add heap.scala for Scala implementation