← Questions
Flatten a linked list with side branches into one doubly linked list
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Each node of a singly linked list has a forward link and may also have one side branch: a link to the head of another list, whose nodes may have side branches of their own. Flatten the whole structure into a single doubly linked list, with each branch spliced in right after the node it hangs from, and set every node's back link. Do it in place and discuss recursion depth versus an iterative approach.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
