sir when I tried the code by myself, the code number line 8 of ur code where " j< length -i", where the "i" is used because you said we dont want to swap the last element during the 2nd iteration. but when I tried the code by myself I noticed if I just wrote "j < length" it gives me the same result sorted in ascending order without the last element touched. so is it valid??
If it's working for other combination of numbers than it's valid. Extra checks are being made in your case since the numbers in the end are already sorted after each iteration
On God, this is the best solution i have seen till now🔥🔥
Thanks. Please subscribe and share with your friends 🙂
Thank You ! Very clearly explained..
Glad it was helpful!
Bro, please explain why did you write for loop with i again in the end?
last for loop with i is to print all numbers in array after sorting them, in the format we want, space separated or using commas, etc.
the lecture was very good.
thanks
Thank u so much , easily understand explanation..........
You are most welcome
Thank you soo much ! Very well explained brother. Keep it up ! Already Subscribed to you channel. Love from Mumbai
Thank you so much. Love from Pune :)
Thanks sir your video helped me so much
Glad it was helpful. Share with your friends 🙂👍
Thank you so much! hope I can learn more from you sir.
Welcome.. subscribe and share with your friends
Nice Explanation Sir 🙂
Thanks and welcome
Thank you so muchh❤❤
Glad you found it helpful! 👍
Thank you so much, good explanation ❤️
Welcome 👍🙂
Keep it up ❤️
yes thanks. keep supporting :)
thank you sir
Welcome
sir when I tried the code by myself, the code number line 8 of ur code where " j< length -i", where the "i" is used because you said we dont want to swap the last element during the 2nd iteration. but when I tried the code by myself I noticed if I just wrote "j < length" it gives me the same result sorted in ascending order without the last element touched. so is it valid??
If it's working for other combination of numbers than it's valid. Extra checks are being made in your case since the numbers in the end are already sorted after each iteration
Thank you 😊
You're welcome 😊
Thankx
Welcome
Can u pls tell me why u did l-i in the inner loop I can't understand though u already have told about this please help
And for descending order?
Make video for reverse array
how about from highest to lowest output? badly need.
for highest to lowest - use condition arr[j-1] < arr[j]
In if condition why we need to take (arr[ j-1 ] >arr [ j ] ).
Why we should not take ( [ j-1]>[ j ] ) by removing arr before j-1& j
j represents the position and arr[j] represents the number at that position so we have to use arr to compare numbers and not the positions for sorting
How to sort alphanumeric
Its very hard to understand the for loops.
I undertand what bubble sort is. But the code itself i cant understand
More practice will make your concepts easier
Sir