OpenGenus / cosmos

World's largest Contributor driven code dataset | Used in Quark Search Engine, @OpenGenus IQ, OpenGenus Visual Project
http://internship.opengenus.org
GNU General Public License v3.0
13.58k stars 3.69k forks source link

Print Nth node of a singly linked list in the reverse manner #669

Open rstalekar opened 7 years ago

rstalekar commented 7 years ago

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.

rstalekar commented 7 years ago

I am implementing this in C.

foobar98 commented 7 years ago

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

AdiChat commented 7 years ago

Sure. Go for it 👍

rstalekar commented 7 years ago

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

AdiChat commented 7 years ago

Which one? Did you make a pull request?

rstalekar commented 7 years ago

Yes of course

AdiChat commented 7 years ago

Yes. I see. I have merged it 🎉

rstalekar commented 7 years ago

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

AdiChat commented 7 years ago

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

foobar98 commented 7 years ago

In which directory should I add my file?

AdiChat commented 7 years ago

Create a folder n_th_node_linked_list under here and place your code there 👍

foobar98 commented 7 years ago

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

AdiChat commented 7 years ago

Merged 👍

MarsMSJ commented 7 years ago

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

rstalekar commented 7 years ago

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

rstalekar commented 7 years ago

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.

anku580 commented 7 years ago

I would like to do this in c++

rstalekar commented 7 years ago

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

AdiChat commented 7 years ago

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

rstalekar commented 7 years ago

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.

AdiChat commented 7 years ago

You need to clone your local copy that is this one

rstalekar commented 7 years ago

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

rstalekar commented 7 years ago

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.

AdiChat commented 7 years ago

You need to update your clone 👍

rstalekar commented 7 years ago

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

rstalekar commented 7 years ago

What must I do?

rstalekar commented 7 years ago

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

AdiChat commented 7 years ago

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

rstalekar commented 7 years ago

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

rstalekar commented 7 years ago

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

AdiChat commented 7 years ago

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

rstalekar commented 7 years ago

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

rstalekar commented 7 years ago

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

AdiChat commented 7 years ago

You can create a pull request from here 👍

rstalekar commented 7 years ago

I created it, can you see it?

rstalekar commented 7 years ago

I navigated to my repository and created the pull request

aish51197 commented 7 years ago

I am adding a code in python.