Linked List

    LeetCode / Linked List / 148번 / Sort List / JS

    Sort List - LeetCode Can you solve this real interview question? Sort List - Given the head of a linked list, return the list after sorting it in ascending order. Example 1: [https://assets.leetcode.com/uploads/2020/09/14/sort_list_1.jpg] Input: head = [4,2,1,3] Output: [1, leetcode.com 리스트에 있는 노드들을 오름차순으로 정렬하는 문제이다. /** * Definition for singly-linked list. * function Lis..

    LeetCode / Linked List / 328번 / Odd Even Linked List / JS

    Odd Even Linked List - LeetCode Can you solve this real interview question? Odd Even Linked List - Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered od leetcode.com 홀수번째 노드들을 앞으로 오게 하고, 짝수번째 노드들은 뒤로 보낸다. /** * Definition for singly-linke..

    LeetCode / Linked List / 234번 / Palindrome Linked List / JS

    Palindrome Linked List - LeetCode Can you solve this real interview question? Palindrome Linked List - Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Example 1: [https://assets.leetcode.com/uploads/2021/03/03/pal1linked-list.jpg] Input: hea leetcode.com 주어진 Linked List가 팰린드롬인지, 즉 앞으로해도 뒤로해도 같은지 판단하는 문제이다. /** * Definition for..

    LeetCode / Linked List / 19번 / Remove Nth Node From End of List / JS

    Remove Nth Node From End of List - LeetCode Can you solve this real interview question? Remove Nth Node From End of List - Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: [https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg] leetcode.com 주어진 Linked List에서 뒤에서 n번째 요소를 제거하고 반환한다. /** * Definition for si..

    LeetCode / Linked List / 142번 / Linked List Cycle II / JS

    Linked List Cycle II - LeetCode Can you solve this real interview question? Linked List Cycle II - Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be r leetcode.com 순환을 할 수도 있고, 순환하지 않을 수도 있는 Linked List가 주어진다. 만약 어딘가의 위치에서 순환이 이루어지고 있는 ..