toArray


Description:

public T[] toArray ()

Returns the elements as a native array. The order is not guaranteed to be sorted.

Example:

    var pq = new PriorityQueue<string> ((a, b) => {
return strcmp (a, b);
});
pq.add ("b");
pq.add ("a");
string[] arr = pq.toArray ();
assert (arr.length == 2);

Returns:

a new array containing all elements.