Doubly linked list

here’s my code for doubly linked list:

please tell me the problem in my code

Hey, you have problem in print function on line 36 .
Test this 1 2 3 4 -1 Here it will print everything except last element
because on line 36 condition of loop is while(head->next!=NULL) but it should be while(head!=NULL)

Marking this as resolved ,reopen if required :slight_smile:

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.