BST to Sorted Linked LIst

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;
}

what is the meaning of this line leftLL.tail->right = root;

Here Linked list has only two pointers head and tail then from where this right has come??

At any root node leftLL is the linked list formed from the left subtree.
You have to attach the tail of the linked list formed by the left subtree to the root node.
So we do leftLL.tail->right = root;

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.