Study of leading hadrons in gluon and quark fragmentation