Exploiting Tree Structure for Credit Assignment in RL Training of LLMs