//There is a build in method //Just import array import java.util.Arrays; //And for example Int arrayName[]={8,2,6,7}; Arrays.sort(arrayName); //The new array is {2,6,7,8} //then it is sorted
You didn't put in your braces on the first for loop, so how possible didn't it show errors. And if you were not going to put braces, you could have still closed it with semicolon.. i am still wondering why there were no bugs in that code.
if you have only one line of code in for loop than curly braces are optional. Curly braces in for loop are required for multiple lines of code inside for loop hope this helps.
x = 1 y = 2 Ye dono variables ki values Hume interchange karni hai.. to ye karenge: temp = x (temp me 1 store ho gaya) x = y (x me 2 store ho gaya) y = temp (ab y me 1 store ho gaya Jo humne x se liya tha) so now: x = 2 y = 1 Values interchange ho gayi.. Bas yahi hai line 13, 14, 15 me.. Practice Karo
Dziękuję za ten filmik. Pozdrowienia z Polski 😊
Welcome 🤗
bro very good explenation and technique
Thanks and welcome
you deserve more likes and subscribers. You're a life saver, thank you so much for this content.
Thanks for your appreciation.. share with your friends
This was really helpful as I am learning for the first time...thank you so much!!
Welcome 🙂
Please subscribe and share with your friends
Number of sorting methods is there, can you please make video to compare all sorting methods
Very clear. Thanks 🙏🏾
Welcome 🤗
Amazing Thank you
Welcome 😊
You're doing a great job brw! Thank you 😌♥️
You are so welcome
this is really helpful
Thanks 👍
Thank-you something.
Welcome
Is this insertion sort or selection sort
This is simple sort
Watch this video to know selection and insertion sort algorithms
th-cam.com/video/QhtGiq2GBn0/w-d-xo.html
If you have a million numbers that would take for ever. How would you do it in that case?
//There is a build in method
//Just import array
import java.util.Arrays;
//And for example
Int arrayName[]={8,2,6,7};
Arrays.sort(arrayName);
//The new array is
{2,6,7,8}
//then it is sorted
it would not take the computer forever.
@@officialyusra O(n^2) isn’t good enough in some cases. @alkrki510 has the best solution
thank you sir😍
Welcome 😊
You didn't put in your braces on the first for loop, so how possible didn't it show errors. And if you were not going to put braces, you could have still closed it with semicolon.. i am still wondering why there were no bugs in that code.
if you have only one line of code in for loop than curly braces are optional. Curly braces in for loop are required for multiple lines of code inside for loop
hope this helps.
Can we use j=i in inner loop
thanks
Welcome
thank you :)
welcome
where are you going .....pls reduce your speed
Thanks for your feedback. Will improve
Set your playback speed to 0.75 if it’s too fast for you to understand
Index out of bound
I+1 does not exist
Check your indices
i needs to be smaller than array.length-1, because j=i+1, so fix for that is: for(i=0; i
I think its spelt as array not aarrae!bro
Line no 13 14 15 bounce ho gya kucch samjh nahi aaya
x = 1
y = 2
Ye dono variables ki values Hume interchange karni hai.. to ye karenge:
temp = x (temp me 1 store ho gaya)
x = y (x me 2 store ho gaya)
y = temp (ab y me 1 store ho gaya Jo humne x se liya tha)
so now:
x = 2
y = 1
Values interchange ho gayi..
Bas yahi hai line 13, 14, 15 me..
Practice Karo
@@programmingforbeginners7392 Got it Thank you soo much