We have a set, $L$, of lists of elements from the set $N = \{ 1, 2, 3, ..., n \}$. Each element from $N$ appears in a single list in $L$. I am looking for a data structure which can perform the following updates:
$concat(x, y)$ : concatenates the list containing $y$ onto the end of the list containing $x$
$split(x)$ : splits the list containing $x$ directly after $x$
It also needs to perform the following queries:
$follows(x, y)$ : returns $true$ if $x$ and $y$ are in the same list and $y$ comes after $x$ (but is not necessarily adjacent to $x$)
$first(x)$ : returns the first element of the list containing $x$
$next(x)$ : returns the the next element after $x$ in the list containing $x$
I have already come up with a data structure which performs these updates in $O(lg^2 (n))$ and queries in $O(lg (n))$ time. I'm mostly interested in whether or not there is already a data structure which can do this (hopefully faster?).
Motivation: rooted directed forests can be represented with two of these list sets and they allow quick calculation of reachability in such forests. I want to see what else they can be used for and if all of this is already known.