top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Find the given doubly linked list is palindrome or not?

0 votes
882 views
Find the given doubly linked list is palindrome or not?
posted Feb 20, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
  1. Take two pointers and set one pointer at start and another at last.
  2. Run a loop till start and last is not equal.
  3. On each iteration move Start pointer to next and last pointer to prev
  4. At each move (Step 3) check if both values not equal return false
  5. Return true outside the loop (step 2 completion).
answer Feb 21, 2017 by Salil Agrawal
...