mohammedwaris / core-go

Programs in Go language
0 stars 0 forks source link

Delete Algorithm #2

Open nawazish-github opened 6 years ago

nawazish-github commented 6 years ago

I think we can improve on the delete algorithm. Right now it seems to be complex. Probably the complexity is because you are maintaining the prev reference.

In your algorithm you are forced to maintain the prev reference because you have started from the first node in the list; instead if you start from an imaginary zeroth node then you will not be required to maintain the prev reference.