The empty? is an inbuilt function in Ruby checks if the SizedQueue is empty or not?. It returns a boolean value, which is true if the SizedQueue is empty or it returns false. Empty here means if it contains elements or not in it.
Parameters: The function does not takes any element.
Return Value: It returns true if the SizedQueue is empty else it returns false.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.