Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removeAt function in linked-list #83

Closed
TheSTL opened this issue Oct 13, 2019 · 6 comments
Closed

removeAt function in linked-list #83

TheSTL opened this issue Oct 13, 2019 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@TheSTL
Copy link
Member

TheSTL commented Oct 13, 2019

Linked-list removeAt 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

@TheSTL TheSTL added bug Something isn't working Hacktoberfest labels Oct 13, 2019
@adavijit
Copy link

Please assign this to me

@TheSTL
Copy link
Member Author

TheSTL commented Oct 13, 2019

hi @adavijit can you solve this issue?

@adavijit
Copy link

No! please assign it to others! I am getting the wrong result

@TheSTL
Copy link
Member Author

TheSTL commented Oct 13, 2019

@adavijit Your try is not bad , i can see in PR- [#84 ].
There are 3 cases in removeAt:

  • If index =0, then this.head = this.head.next
  • Else If index = linkedList.length -1, then find previous node and set next value to null (previous.next = null)
  • Else find previous (i-1) and current (i) node, then previous.next = current.next;

If you think i'm wrong you can tell me.
Do you want to try it again?

@adavijit
Copy link

Yes! I am trying

@k88manish
Copy link
Contributor

k88manish commented Oct 20, 2019

Hi @adavijit, Are you still working on this? If not I can pick this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants