Can we use a doubly linked list in this question?

Can we use a doubly linked list in this question?

@Doctor_Insult nhi bro ap doubly ll nhi kr skte kyunki khi question me function dia hota hai only ,ll unhone pehle se bnakr function me pass ki hoti hai ,ye question mainly singly ll ka hai.

but then it will have O(n^2) complexity

@Doctor_Insult you can also do in O(n) .Split linked list from middle in two and reverse the second half and start comparing both half ,if there is mismatch than it is not palindrome else it is palindrome.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.