Your output is missleading -1 -4 -6 -20 3 8 5 7 30 40 you didn't keep the order. So, your code will not keep the order. that is another problem that is more difficult.
6. Given an array whose elements is monotonically increasing with both negative and positive numbers. Write an algorithm to find the point at which list becomes positive. 7. Given a sorted array, find a given number. If found return the index if not, find the index of that number if it is inserted into the array. bro these are 2 problems can u give me video lecture in this problems
How does this preserve the original order among the negetive and positive numbers...That part is interesting.
sir,but the releative order of positive and negative number has changed.how can we maintain the order in which they appear
Shri Radhe Radhe Ji 🙏🙏🙏 Jai Laddu Gopal Ji 🙏🙏🙏 Shri Kunj Bihari Ji 🙏🙏🙏 Shri Haridas Ji 🙏🙏🙏 Jai Ho Meri Priya Radhika Maai Ji 🙏🙏🙏
To preserve the order, you can track the first swap index and from there reverse the values
Your output is missleading -1 -4 -6 -20 3 8 5 7 30 40 you didn't keep the order. So, your code will not keep the order. that is another problem that is more difficult.
you are right
Shri Radhe Radhe Ji 🙏🙏🙏 Jai Ho Meri Priya Radhika Maii Ji 🙏🙏🙏
Make a vidio on how to rearrange element negative and positive in alternative fadhion
Great Explanation!! Got the thing very easily..
Who ever you are I have subscribed to your channel and you show some awesome algorithms, good job mate.
Please teach lot of problems in Arrays, I find recursion easy but array tough.
Thanks a lot Again!!
Yes Srinidhi. Sure.
plz don't stop bro😊 keep on teaching us.
Your explanation is awesome. Thanks Bro!
sir but how to preserve the order of the elements??
We can also use this instead of while(1) and check (l
Bro please tell me if we want to sort this array in another array what will we do?????
please keep on making such videos, they are awsome. Thanks
Could you please explain to us the time complexity of this algorithm? as we see nested while loops
Nested while loop does not increase the complexity as we are iterating each n element single time , so complexity is O(n).
if -1,2,3,-3 are in array then it will break without segerating the elements.
No. It's work fine because first swap 2 and -3 and then break the loop.
Thankyou sir 🙏
what happens when number '0' comes?
code is giving segmentation fault..
please sir is there any solution
Hi Vivekananda you are doing great work, If you can make videos on Graph and backtracking then I will be good for us , thanks
Yes I will make videos on Graph for sure.
Vivekanand Khyade - Algorithm Every Day thanks
but order is not same sir??
Thanks for such useful videos, request you to upload some videos on how to get time complexity/space complexity.
sir can't we just sort the array in ascending order
You havent preserved the order
you have not preserved order. You have shown different output.. should be corrected or change the subject line. its misleading and waste my time..
the video was 5 years ago but still helps
Im so sad 😞 I don’t know anything in math but I really want to , my problem is that I have to start from the beginning
Just Arrays.sort(arr) will be enough
good explanation ,,,but plzz upload some complex questions....thanks for this vdo :)
thanks sir
Input A=[9,4,2,0,-1,-2,8,-4,3,10,-5]
Output A=[10,9,8,4,-4,3,2,-2,0,-1,-5] plz explain the pogram
6. Given an array whose elements is monotonically increasing with both negative and positive
numbers. Write an algorithm to find the point at which list becomes positive.
7. Given a sorted array, find a given number. If found return the index if not, find the index of
that number if it is inserted into the array.
bro these are 2 problems can u give me video lecture in this problems
very informative and easy to understand
Thanks Aditya.
Your answer changed the order
Vivek can you explain Manester algorithm for string search .
Can I apply quick sort??
That is O(n log n) for Quicksort.
But we are doing it in o(n).
Vivekanand Khyade - Algorithm Every Day ...Yes sir.. Thank you so much
Vivekanand Khyade - Algorithm Every Day ... Can you please post a video regarding how to print a BST in vertical form
thank you sir
Any way we can keep it in order .....
The program is wrong at the last I is greater then j so code will not execute
it's using if condition not for..
Plz Add a video for segregation of linked list (even odd)
You did NOT maintain the order. You wasted my time.
Nice explanation. Thanks.
very good explanation sir
Sir can u plz upload the full program of this
Explain this for 1 2 3 -8 -9 4
Preserved original order in ex output
But not while explaining :(
Great !!
Bhai jab solved example me order maintain kia hai to code bhi order maintain rakhne vala batate...faltu time waste ho gya
We can also create a self balancing tree 👌
Your method is totally wrong u don't maintain order
U r telling very complex
Shri Radhe Radhe Ji 🙏🙏🙏 Jai Ho Meri Priya Radhika Maai Ji 🙏🙏🙏
Shri Radhe Radhe Ji 🙏🙏🙏 Jai Ho Meri Priya Radhika Maai Ji 🙏🙏🙏