trekhleb / javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
MIT License
185.07k stars 29.85k forks source link

🐛 Needed code modification for insert method in LinkList code #1004

Open harishnanthan opened 1 year ago

harishnanthan commented 1 year ago

If I use the below-insert method, I will give the input as insert(value, lengthOfTheList). In this scenario, the value is added to the end of the list, but the tail is not changed to the end of the list.

image

In the above example, I add the value at the end of the list, but the tail is not changed to the end. 🐛 tail has another node.

HemanthPaila commented 1 year ago

Hi there,

I want to contribute to this project and take on this issue as my first task. Could you please assign it to me? I am excited to work towards resolving it and will keep the team updated on my progress.

Thanks!