Sir, in the main method we are calling bubblesort
without storing the value of fuction and in the next line we giving sorted array to display function ,how display function is going to get the sorted array why not not the original array
Doubt in bubble sort
@Adhyayan,
When we pass the array in the bubblesort method, the changes are made to that particular array only, unlike C++/C where a copy of the original array is used, here the changes are made to the array itself. Hence we need not store the array.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.