Delete Middle Node Linked List Problem
Delete Middle Node Linked List Problem — ExecCode Easy DSA Practice
Solve the Delete Middle Node Linked List problem on ExecCode. Free online easy DSA practice in Linked List. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given the head of a linked list. Your task is to delete the middle node, and return the head of the modified linked list. The middle node of a linked list of size n is the ⌊n / 2⌋^th node from the start using 0-based indexing, where ⌊x⌋ denotes the largest integer less than or equal to x. - For n = 1, 2, 3, 4, and 5, the middle nodes are 0, 1, 1, 2, and 2, respectively.
Examples
Input {"nums": [1, 2, 3, 4, 5]}; Output 1 2 4 5. Input {"nums": [1, 2, 3, 4, 5, 6]}; Output 1 2 3 5 6. Input {"nums": [1, 2]}; Output 1
Constraints
The number of nodes in the list is in the range [1, 10^5]. 1 <= Node.val <= 10^5
Practice Delete Middle Node Linked List free on ExecCode. Browse DSA problems, topic map, and placement guides.