linked list based on the 3 array implementation