Skip to content

GFG_POTD_25_SEPT_2024.cpp #207

@ambitiouss22

Description

@ambitiouss22

📝 Description

Given a singly linked list of integers. The task is to check if the given linked list is palindrome or not.
Checking if a singly linked list of integers is a palindrome means verifying if the sequence of numbers reads the same from both ends. For instance, 1 -> 2 -> 3 -> 2 -> 1 is a palindrome, while 1 -> 2 -> 3 -> 4 is not.

💡 Enhancement / Feature Request (if applicable)

Efficiency: Implement the check in O(n) time and O(1) space.
Error Handling: Add functionality to handle edge cases, such as empty lists or single-node lists.
Output: Provide detailed feedback on the check, indicating whether the list is a palindrome and the method used to determine this.
Visualization: Include a method to visualize the linked list for better understanding during debugging.
Input Flexibility: Allow the function to accept lists in various formats (e.g., arrays) and convert them to linked lists automatically.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions