addAt function in linked-list
TheSTL opened this issue · 5 comments
TheSTL commented
Linked-list addAt function not working properly.
File location linked-list
Please go through the Contribution Guide here https://github.com/knaxus/problem-solving-javascript#contribution-guide before going forward with this issue.
Thanks
fluffynuts commented
This appears to be working correctly in master (there's a passing test too). What's the issue?
TheSTL commented
- Case 1:
linkedList.addAt(0, 1);
linkedList.addAt(0 ,2);
output :{ data: 1, next: Node { data: 2, next: null } } - Case 2:
linkedList.addAt(0, 1);
linkedList.addAt(0 ,2);
linkedList.addAt(2 ,3);
output:{ data: 1, next: Node { data: 3, next: null } }
There can be more cases where it can fail
ashu8912 commented
Hey Can I take this issue.
ashokdey commented
ok