shivangdubey / HacktoberFest2020

Repository to let enthusiasts create issues and pull requests for the Open Source event
MIT License
34 stars 275 forks source link

changed swap function in Bubblesort.cpp #488

Closed wolfyhell closed 3 years ago

wolfyhell commented 3 years ago

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.