Skip to content

Tag Archives: scala-collection

In Scala Stack class, the forall() method is utilized to check if a predicate holds true for all the elements of the stack. Method Definition:… Read More
In Scala Stack class, the foreach() method is utilized to apply a given function to all the elements of the stack. Method Definition: def foreach[U](f:… Read More
In Scala Stack class, the drop() method is utilized to drop the first ‘n’ elements from the top of the stack. Method Definition: def drop(n:… Read More
In Scala Stack class, the dropRight() method is utilized to drop the last ‘n’ elements of the stack. Method Definition: def dropRight(n: Int): Stack[A] Return… Read More
In Scala Stack class, the dropWhile() method is utilized to drop the longest prefix from the top which satisfies a given predicate in a stack.… Read More
In Scala Stack class, the clear() method is utilized to delete all the elements of the stack. Method Definition: def clear(): Unit Return Type: It… Read More
In Scala Stack class, the clone() method is used to create a copy of the given stack. Method Definition: def clone(): Stack[A] Return Type: It… Read More
In Scala Stack class, the diff() method is used to find the difference between the two stacks. It deletes elements that are present in one… Read More
In Scala Stack class, the copyToArray() method is utilized in copying the elements of the stack to an Array. Method Definition: def copyToArray[B >: A](xs:… Read More
In Scala Stack class, the count() method is utilized to count the number of elements in the stack that satisfies a given predicate. Method Definition:… Read More
In Scala Stack class, the apply() method is utilized to return an element at a given position in the stack. The top of the stack… Read More
In Scala Stack class, the contains() method is utilized to check if an element is present in the stack of not. Method Definition: def contains(elem:… Read More
In Scala Stack class, the pushAll() method is utilized to add the elements from a collection to a stack. Method Definition: def pushAll(elems: IterableOnce[A]): Stack.this.type… Read More
In Scala Stack class, the pop() method is utilized to remove and return the element at the top of the stack. Method Definition: def pop():… Read More
In Scala Stack class, the push() method is utilized to add an element on the top of the stack. Method Definition: def push(elem: A): Stack.this.type… Read More