Answer:
$$
5,\ 2,\ 4,\ 1,\ 3.
$$ Let's call the heights from left to right $a_1,\dots,a_5$. - The fourth note is $3$. Since there are only three positions to the left of the fourth book, those three have to be higher than him. Then
$$
a_4=1.
$$ - The fifth note is $2$. We already know that $a_4=1$, so among the four books on his left there must be exactly two taller than him. This forces the last book to be
$$
a_5=3,
$$
because if it were $2$ it would have three higher ones on the left, and if it were $4$ or $5$ it would have less than two. The heights $2,4,5$ remain for the first three positions, with notes $0,1,1$. - The first note is $0$, so the first book has to be the highest of those three: $a_1=5$.
- For the second and third notes to both be $1$, the remaining two positions can only be $2$ and $4$ in this order. Therefore, the complete row is:
$$
5,\ 2,\ 4,\ 1,\ 3.
$$