Cosmos: Print Nth node of a singly linked list in the reverse manner

Created on 6 Oct 2017  路  37Comments  路  Source: OpenGenus/cosmos

You must be able to fetch the nth node in a singly linked list in the reverse manner
eg:- if there is a list of 100 nodes and node number 10th is passed, you must be able to return the 10th node from the end of the list.

Hacktoberfest add code new algorithm

All 37 comments

I am implementing this in C.

I'd like to implement it in C++.

Sure. Go for it 馃憤

Aditya, were you able to review my reverse link list code

Which one? Did you make a pull request?

Yes of course

Yes. I see. I have merged it 馃帀

Oh is it, why didn't I get a mail then?

You should have overlooked. Take a look at the pull request 馃憤 #518

In which directory should I add my file?

Create a folder n_th_node_linked_list under here and place your code there 馃憤

Made a PR. Kindly review it. #671
Thanks.

Merged 馃憤

How about a version of this algorithm (PrintNthToLast) as a templated algorithm in c++?

Aditya, how can I update the git repository , since when I had cloned earlier there was no directory for the nth node directory

I used git pull, but it shows Already up-to-date, but don't see the directory which you created inside Linked_lists. Can I add and commit this in Linked_lists itself.

I would like to do this in c++

I cloned and did a git add of my soruce code in the n_th_node_linked_list and did a commit, however when i try doing a git push it gives the following error;-
remote: Permission to OpenGenus/cosmos.git denied to rstalekar.
fatal: unable to access 'https://github.com/OpenGenus/cosmos.git/': The requested URL returned error: 403

@rstalekar You need to clone this repository and push in your local work-space 馃憤

What am I doing wrong here as per you?
I did a git clone 'https://github.com/OpenGenus/cosmos.git/ in my home directory
Then I navigated to the Linked_lists/ n_th_node_linked_list and then wrote my code and did git add .
git commit also went through , only when I do git push I get the above error.

You need to clone your local copy that is this one

Ok thanks , in the Contributors list i can see my name now, but I can't see how many commits I have made etc and it shows 100 contributors out of 133. I made 4 commits and you have merged all 4, but yet my name does not appear in the 100

I cloned it , but yet I don't see the sub-directory that you created for nth node. I will do a push in LInked_lists, please review it.

You need to update your clone 馃憤

I did using git pull and is shows
Already up-to-date.

What must I do?

I will do a git push in LInked_lists, do you think that is fine?

You need to do git pull origin master. This will update your local copy 馃憤

$git pull origin master
From https://github.com/rstalekar/cosmos

  • branch master -> FETCH_HEAD
    Already up-to-date.
    Then again I listed
    ls
    find_nth_node_from_end_of_list.c reverse_list.c rotate_list.cpp
    merge_sort_linked_list.cpp reverse_list.cpp

Anyways I did a git push from my repository in Linked_lists , can you please review?

You can submit a pull request. I will fix the location 馃憤

I have already pushed , now can you provide me the link to create pull request?

When I go to Pulll requests and I create new pull request, it goes and shows compare changes

You can create a pull request from here 馃憤

I created it, can you see it?

I navigated to my repository and created the pull request

I am adding a code in python.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arnavb picture arnavb  路  3Comments

Josh5231 picture Josh5231  路  4Comments

sebasrp picture sebasrp  路  3Comments

ivanrein picture ivanrein  路  4Comments

grantmwilliams picture grantmwilliams  路  4Comments