In any language, I would write following:
struct Node {
void* data;
Node* next;
}
...
head.next = new Node(data, null)
But it seems that solidity doesn't have a concept of pointers.
How could it be done here?
EDIT The answer at the end of Are there well-solved and simple storage patterns for Solidity? is not enough for me as I also need to insert nodes to the middle.