Skip to content

Palindrome Check Function for Linked Lists #656

Open
@asmit27rai

Description

@asmit27rai

Add Palindrome Check Function for Linked Lists

Description:
A palindrome check function is needed for linked lists to determine if the sequence of elements in the linked list reads the same forwards and backwards. This function should work for all types of linked lists (Singly, Doubly, Circular, etc.).

Proposed Solution:
Implement a is_palindrome method in the LinkedList class. This method will:

  1. Traverse the linked list and store the elements in a temporary array.
  2. Compare the array with its reverse to determine if it is a palindrome.
  3. Return True if the linked list is a palindrome, otherwise False.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions