Convert an array to an object representing a singly linked list