An error occurred while loading the file. Please try again.
-
Muddsair Sharif authoredf064c792
function Node(value) {
this._ = value;
this.next = null;
}
export default function(array) {
var i,
n = (array = array.slice()).length,
head = null,
node = head;
while (n) {
var next = new Node(array[n - 1]);
if (node) node = node.next = next;
else node = head = next;
array[i] = array[--n];
}
return {
head: head,
tail: node
};
}