Deleting a Node from Singly Linked List is rather straight forward.

  • You have to know the head first of all

  • Start by checking the head if that’s the one you are looking for

  • Keep moving forward and checking - always check for null pointers everywhere

Before we talk about the code, let’s see how Linked List is setup.

Now, below is the code for it….

Code

As usual the code is available here:

https://github.com/abhi1010/Algorithms