One of the Microsoft's commonly asked interview questions according to Leetcode.
Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly.
It is guaranteed that the node to be deleted is not a tail node in the list.
Example 1:
Input: head = [1,2,3,4], node = 3
Output: [1,2,4]
Example 2:
Input: head = [0,1], node = 0
Output: [1]
Example 3:
Input: head = [-3,5,-99], node = -3
Output: [5,-99]
Follow me on Github:https://github.com/Gokulesh2001
Follow me on LinkedIn:https://www.linkedin.com/in/gokulesh-k-a-13a16b199
Download
0 formats
No download links available.
DELETE WITHOUT HEAD POINTER | MICROSOFT | LEETCODE | TAMIL | NatokHD