Bubble and merge sort on linked lists