if(curr == head) { head = tmp; prev = tmp; } else { prev->next = tmp; prev = prev->next; 如果是交換 curr->val 應該就不需要這段