Skip to content

style: cleanup PalindromeSinglyLinkedList #4336

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

Merged

Conversation

vil02
Copy link
Member

@vil02 vil02 commented Aug 28, 2023

As mentioned in #4327, the implementation of PalindromeSinglyLinkedList.isPalindrome has unnecessarily high time complexity O(n^2). Thanks to #4334, the implementation could be changed to optimal O(n). This PR does that and makes PalindromeSinglyLinkedList a proper utility class.

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.

@vil02 vil02 marked this pull request as ready for review August 28, 2023 17:16
Copy link

@dineshchitlangia dineshchitlangia left a comment

Choose a reason for hiding this comment

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

LGTM, non-binding.

@vil02 vil02 force-pushed the cleanup_PalindromeSinglyLinkedList branch from bdc28bc to c2ac1f9 Compare September 2, 2023 08:08
@siriak siriak enabled auto-merge (squash) September 2, 2023 17:02
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak siriak merged commit cfdbc41 into TheAlgorithms:master Sep 2, 2023
@vil02 vil02 deleted the cleanup_PalindromeSinglyLinkedList branch September 2, 2023 19:35
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.

3 participants