Shiro nailed it.
second reguarding,
nth_node(nodes,1)->left = nth_node(nodes,2);
this is a perfectly legal line of code in C and C++, here is why.
to break it down as simple as possible in sequence.
Code:
nth_node(nodes,1)->left = nth_node(nodes,2)
the functions nth_node() is called first, it now reads like this.
returned_pointer_to_1->left = returned_pointer_to_2;
where 'returned_pointer_*' is the node_t* returned by the function nth_node().
now,
'returned_pointer_to_1' is first deferenced by '->' operator
and then its member 'left' is accessed, it could be rewritten like so
(*returned_pointer_to_1).left = returned_pointer_to_2;
then asignment takes place, i think you understand the rest.