swapchildren

CF

Function swapChildren

function swapChildren: The function/method swapChildren accepts two arguments root and X. The root is a pointer to…