Skip to content

Conversation

visha09
Copy link
Contributor

@visha09 visha09 commented Oct 27, 2021

Code for reversing a linked list in c++

Code for reversing a linked list in c++
@vercel
Copy link

vercel bot commented Oct 27, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/snowflakedev/code-examples/6Kn2LxGSdEC3iR9geJKfAbh91fQY
✅ Preview: https://code-examples-git-fork-visha09-patch-1-snowflakedev.vercel.app

Copy link
Member

@rhygg rhygg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files requires. a valid extension.
In this particular example, the file requires a .cpp extension with a absolute file name, like reverse-linked-list.
Appreciate your contribution 👍🏻


void push(int data)
{
Node* temp = new Node(data);
Copy link
Contributor

@null8626 null8626 Oct 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dynamically allocating a memory block in C/C++ with the new keyword must be freed somewhere when the program ends or when the class's destructor is called with the delete keyword otherwise it would cause a memory leak.

@KartikeSingh
Copy link
Member

Closing the PR because no response from @visha09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants