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

Update linked_list_palindrome.cpp #6730

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jvishad
Copy link

@jvishad jvishad commented Oct 5, 2023

Fixes issue:
Reduced the additional space complexity of the code.

Changes:
Changed the vector approach to the linked list approach which doesn't use additional vector which saves our extra space.

e--;
}
return 1;
bool isPalindrome(Node* head) {
Copy link
Member

Choose a reason for hiding this comment

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

Do mention if you are making a specific improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants