BST to Sorted Linked List Convert / Flatten a Tree

in this if(root->left!=NULL && root->right==NULL){
LinkedList leftLL = flatten(root->left);
leftLL.tail->right = root;

    l.head = leftLL.head;
    l.tail = root;
    return l;
}

i didnt understnd this line leftLL.tail->right = root;?

is line ka matlab hai ki jo linked list left subtree se aarahe hai uski tail point karge root node ko toh fir leftLL.tail=root hona chaiye thaa naa?

Are basically agar left mein exist karta hai tree toh left linklist banake ab hamare paas 2 cheez hai ek linklist jo pure left subtree se bani hai aur root . So linklist ka tail ka next pointer root se connect kardo toh badhi linklist bangayi aur ab tail root hogaya

So linklist ka tail ka next pointer root se connect kardo???
tail ka nex pointer ?
linked list class mai head aur tail pointer banaye hai
mai puch raha hu ye right kya hai i.e leftLL.tail->right?

@jatinupadhyay786 left linklist ka tail access kara aakhir hai toh vo tree ki node so uska right connect kardiya root se aur tail ko root bana diya
vo samjhane ke liye bola tha ki bas left vali linklist ko right se connect kardiya

bhai lekin right toh null hai
please example se samjha do mujhe concept clear hai bas code ke iss part mai im getting confused

Ok diagram banake bhejdunga thodhi der mein

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.