Convert BST to Linked List

My code is working fine when I remove the class LinkedList and function flatten. but as i include that function its giving segmentation fault. whats the error?

hello @nilotpal

make default constructor in ur linkedlist class and in that assign head and tail as NULL

LinkedList()

{

    head = NULL;

    tail = NULL;

}

I am making this as default constructor. still giving segmentation fault

see, still not working

try now

1 Like

yeah! got it :man_facepalming:

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.