Tag Archives: Ruby Queue-class

The size() is an inbuilt function in Ruby returns the current size of the Queue or the number of objects present in it. Syntax: q_name.size()… Read More
The length() is an inbuilt function in Ruby returns the current length of the Queue or the number of objects present in it. Syntax: q_name.length()… Read More
The new() is an inbuilt function in Ruby creates a new queue of the given name. Syntax: q_name = Queue.new() Parameters: The function does not… Read More
The shift() is an inbuilt function in Ruby returns the element in the front of the queue and removes it from the queue. Syntax: q_name.shift()… Read More
The enq() is an inbuilt function in Ruby inserts the element in the queue. Syntax: q_name.enq(element) Parameters: The function takes the element to be inserted… Read More
The pop() is an inbuilt function in Ruby returns the element in the front of the queue and removes it from the queue. Syntax: q_name.pop()… Read More
The deq() is an inbuilt function in Ruby returns the element in the front of the queue and removes it from the queue. Syntax: q_name.deq()… Read More
The closed? is an inbuilt function in Ruby checks if the queue is closed or not?. It returns a boolean value, which is true if… Read More
The empty? is an inbuilt function in Ruby checks if the queue is empty or not?. It returns a boolean value, which is true if… Read More
The clear() is an inbuilt function in Ruby clears the queue and makes it size to be zero again. We can re-insert objects again to… Read More
The push() is an inbuilt function in Ruby inserts the element in the queue.  Syntax: q_name.push(element) Parameters: The function takes the element to be inserted… Read More
The close() is an inbuilt function in Ruby closes the queue permanently and does not allow any more push or pop operations in it. A… Read More
The <<() is an inbuilt function in Ruby inserts the element in the queue. Syntax: q_name << element Parameters: The function takes the element to… Read More