Examples:
Input: LinkedList: 1->2->1->1->2->1 Output: true Explanation: The given linked list is 1->2->1->1->2->1 , which is a palindrome and Hence, the output is true. Input: LinkedList: 1->2->3->4 Output: false Explanation: The given linked list is 1->2->3->4, which is not a palindrome and Hence, the output is false. Expected Time Complexity: O(n)
Expected Auxiliary Space: O(1)
Constraints:
1 <= number of nodes <= 105
1 ≤ node->data ≤ 103
Description
Please include a summary of the changes and the related issue(s) this pull request addresses. Include any relevant context or background information.
Fixes: #[issue_number] (replace with the issue number, if applicable)
Use [x] to represent a checked (ticked) box.✅
Use [ ] to represent an unchecked box.❌
Type of Change
[ ] Question Added
[ ] Solution Added
[ ] Other (please specify):
Checklist
[ ] I have performed a self-review of my code.
[ ] I have commented my code, particularly in hard-to-understand areas.
[ ] I have made corresponding changes to the documentation (if applicable).
[ ] My changes generate no new warnings.
[ ] I have added tests to cover my changes (if applicable).
[ ] All new and existing tests pass.
Additional Notes
Please add any other information that is relevant to this pull request, including potential risks, alternative solutions considered, or future improvements.
Examples: Input: LinkedList: 1->2->1->1->2->1 Output: true Explanation: The given linked list is 1->2->1->1->2->1 , which is a palindrome and Hence, the output is true. Input: LinkedList: 1->2->3->4 Output: false Explanation: The given linked list is 1->2->3->4, which is not a palindrome and Hence, the output is false. Expected Time Complexity: O(n) Expected Auxiliary Space: O(1) Constraints: 1 <= number of nodes <= 105 1 ≤ node->data ≤ 103
Description
Please include a summary of the changes and the related issue(s) this pull request addresses. Include any relevant context or background information.
Fixes: #[issue_number] (replace with the issue number, if applicable)
Use [x] to represent a checked (ticked) box.✅ Use [ ] to represent an unchecked box.❌
Type of Change
Checklist
Additional Notes
Please add any other information that is relevant to this pull request, including potential risks, alternative solutions considered, or future improvements.