Scala Queue min() method with example Last Updated : 29 Oct, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The min() method is utilized to return the smallest element of the queue. Method Definition: def min: A Return Type: It returns the smallest element of the queue. Example #1: Scala // Scala program of min() // method // Import Queue import scala.collection.mutable._ // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating a queue val q1 = Queue(1, 3, 2, 7, 6, 5) // Print the queue println(q1) // Applying min method val result = q1.min // Display output print("The smallest element of the queue: " + result) } } Output: Queue(1, 3, 2, 7, 6, 5) The smallest element of the queue: 1 Example #2: Scala // Scala program of min() // method // Import Queue import scala.collection.mutable._ // Creating object object GfG { // Main method def main(args:Array[String]) { // Creating a queue val q1 = Queue(5, 11, 23, 72, 14, 21, 118) // Print the queue println(q1) // Applying min method val result = q1.min // Display output print("The smallest element of the queue: " + result) } } Output: Queue(5, 11, 23, 72, 14, 21, 118) The smallest element of the queue: 5 Comment More infoAdvertise with us Next Article Scala Queue min() method with example R rupesh_rao Follow Improve Article Tags : Scala Scala Scala-Method scala-collection Similar Reads Scala Int min() method with example The min() method is utilized to return the minimum value of the two specified int numbers. Method Definition: (First_Number).min(Second_Number)Return Type: It returns true the minimum value of the two specified int numbers. Example 1: Scala // Scala program of Int min() // method // Creating object 1 min read Scala Set min() method with example The max() method is utilized to find the smallest element of all the elements in the stated list. Method Definition: def min: A Return Type: It returns the smallest of all the elements in the stated list. Example #1: Scala // Scala program of min() // method // Creating object object GfG { // Main m 1 min read Scala Map min() method with example The min() method is utilized to find the smallest element of the map. Method Definition: def min: (A, B) Return Type: It returns the smallest element of the map. Example #1: Scala // Scala program of min() // method // Creating object object GfG { // Main method def main(args:Array[String]) { // Cre 1 min read Scala List min() method with example The min() method is utilized to find the smallest element of all the elements in the stated list. Method Definition: def min[B >: A](implicit ord: math.Ordering[B]): A Return Type: It returns the smallest of all the elements in the stated list. Example #1: Scala // Scala program of min() // metho 1 min read Scala Char min() method with example The min() method is utilized to find the minimum of the two specified characters. Method Definition: def min(that: Char): Char Return Type: It returns the character with the minimum value. Example: 1# Scala // Scala program of min() // method // Creating object object GfG { // Main method def main(a 1 min read Like