The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can be used?

I think it should be doubly link list ? What should be its answer ?

You can concatenate two singly-linked lists in O(1) time as long as you store pointers to both the first and last elements of the list. You’d just rewire the next pointer of the last element of the first list to the first element of the second list. This also works with doubly-linked lists.
So yes doubly linked list is the correct answer.

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.