VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/queue-toarray-method-in-c-sharp/

⇱ Queue.ToArray Method in C# - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Queue.ToArray Method in C#

Last Updated : 11 Jul, 2025
This method is used to copy the Queue elements to a new array. The Queue is not modified and the order of the elements in the new array is the same as the order of the elements from the beginning of the Queue to its end. This method is an O(n) operation and comes under Syntax:
public virtual object[] ToArray ();
Return Value: It returns a new array containing elements copied from the Queue. Below given are some examples to understand the implementation in a better way: Example 1:
Output:
Geeks
Geeks Classes
Noida
Data Structures
GeeksforGeeks
Example 2:
Comment

Explore