
148. Sort List
·
Algorithm
Sort List - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 단방향 연결 리스트가 주어진다. 주어진 연결 리스트를 value 값 기준으로 오름차순 정렬해 반환하는 문제다. 단 가능하다면 시간 복잡도를 O(NlogN), 추가 공간 없이 해결해보는 것이 요구사항이다. 예시 Input: head = [4,2,1,3] Output: [1,2,3,4] Input: head = [-1,5,3,4,0] Output: [-1,0,3,4,5] 풀이 1 from typin..