We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
In python, you dont have to create a temp variable to swap elements. So, you can easily them by interchanging their values in this way. Here,
the value of a[i] is assigned to a[i+1] and vice versa.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sorting: Bubble Sort
You are viewing a single comment's thread. Return to all comments →
In python, you dont have to create a temp variable to swap elements. So, you can easily them by interchanging their values in this way. Here, the value of a[i] is assigned to a[i+1] and vice versa.