Linked list implemntation with performance constraints