Sorted array to linked list