Reverses the order of the elements of list in place. Elements are written with set, so open iterators and cursors stay valid and see the new order.
list
set
Time: O(n).
The list to reverse.
TypeError when list is not a list from this library.
const list = new ArrayList([1, 2, 3])reverse(list) // list is now [3, 2, 1] Copy
const list = new ArrayList([1, 2, 3])reverse(list) // list is now [3, 2, 1]
Reverses the order of the elements of
listin place. Elements are written withset, so open iterators and cursors stay valid and see the new order.Time: O(n).