Straightening Multilevel DLL

plz give me code, which create Multilevel doubly linked list by given this sample inputs.

Hi Adarsh,
refer this --> https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/discuss/792707/C%2B%2B-Easy-and-Intuitive-Recursive-Solution-or-With-Whiteboard-Diagrams-or-No-extra-space

Hi Vaibhav,
I have also solve this question at leetcode, but in course assignment, we have to solve it from scratch,
while the input is like
Input:- [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]
so, my question is that, How to I create a multilevel double linked list with child connection too.
plz provide me code which create a multilevel linked list with child connection too.
So that giving head pointer of this Initial Multilevel linked list in function as arguments, we will update our DLL in straighten form.
EXAMPLE
Input: [1, 3, 2]
You have to provide a code which create this input in Multilevel Double linked list like below
1—2---NULL
|
3—NULL
After then I am able to solve this function part, that is not a big issue.
Thanks

Input:- [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]
you have to provide code of below DLL.

1=2=3=4=5=6–NULL
|…|…|
n.,n.,7=8=9=10
‘’’’’’’’’’’’’’’’’|
‘’’’’’’’’’’’’’'11=12

n–represent NULL
and extra dots or char is just to make clear image of linked list what i want to make by this given inputs.
Hope you understand, what I want to say.

okay okay… will send u

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.

Noooo, How can you close the doubt and hoping that you have cleared my doubt without giving me a solution?

Hi @imadarshanand


But it is written in java.
Java is very much similar to C++ in terms of syntax.
So, you won’t find any difficulty in understanding the logic.