homework 6 submission

This case is a bit more complicated. If next(k,r->left) returns NULL, then you should return r here.