Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 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