Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/Stack/Scala/stack-2.scala
Normal file
9
Task/Stack/Scala/stack-2.scala
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import collection.mutable.{ Stack => Stak }
|
||||
|
||||
class Stack[T] extends Stak[T] {
|
||||
override def pop: T = {
|
||||
if (this.length == 0) error("Can't Pop from an empty Stack.")
|
||||
else super.pop
|
||||
}
|
||||
def peek: T = this.head
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue