iyo shati ntabwo ijyana nipantaro azire guhunga ibitagukanga for the base case where r is a leaf node no replacement is required