Now the swap function is taking arguments by reference(not by pointers), i.e. to use swap you don't pass parameters with the *.
Also, it checks whether the arguments are the same variable(with the same address), and swaps the values without temporary variable.
Now the swap function is taking arguments by reference(not by pointers), i.e. to use swap you don't pass parameters with the *. Also, it checks whether the arguments are the same variable(with the same address), and swaps the values without temporary variable.