Skip to content

Function to check whether the given Singly Linked List is Palindrome or not. #2100

@Avibtb

Description

@Avibtb

Added the Function that will check whether the given Linked List is Palindrome or not

Implemented the following function to check whether the given Linked List is Palindrome or not

  • takeinput - to take input from user.
  • reverse - to reverse the Linked List.
  • isPalindrome - to check whether the Linked List is Palindrome or not.

Added few examples :

  • Input 1 : 9 2 3 3 2 9 -1
  • Output 1 : true
  • Exaplanation : If we reverse the above Linked List ,it will become "9 2 3 3 2 9" which is same as original so it is Palindrome.
  • Input 2 : 0 2 3 2 5 -1
  • Output 2 : false
  • Exaplanation : If we reverse the above Linked List ,it will become "5 2 3 2 0" which is not same as original so it is not Palindrome.

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