This is a wrong solution in case of 1 2 3 4 5 Correct o/p will be 2 3 4 5 5 but according to his solution it will be 5 5 5 5 5 . we need to use stack to reduce the time complexity to O(n).
In the case of 1 2 3 4 5 correct output would still be 5 5 5 5 5. Because you have to choose the largest number in the array. Please see the video again as the guy has explained with perfection
I have a Binary Search Tree with the addition that each node is colored Red or Black (it is not a Red Black Tree). I'm writing methods to determine if the given BST is a valid Red Black Tree (all Red Black Tree properties are met). The only method I cannot figure out is the property that any path from any node to any null node contains the same number of black nodes. Any suggestions?
Hi Sir, I want to learn data structures and algorithm in Python language. What measures can be taken? And where do I start? I would like to discuss this with you personally if you don't mind.
I don't think this is a correct solution. For the case [ 6, 7, 3, 8] the output will be [8, 8, 8, 8] while the correct output will be [7, 8, 8 , 8]. Please correct me if I am wrong.
The correct output is 4 4 4 4. The comparison is made with the whole array from that particular element till the end of array. Anything greater in that portion is selected. See the video again so that you can understand better.
i am a great fan of yours, just a small piece of advice, please cross check the solutions you provide, this solution is wrong, and a couple more of your solutions are wrong from other videos
@@nickjames2059 No, his algorithm is correct. The title of the video may be causing some confusion. The goal is to replace the integer at the current index with the highest integer in the subset of the array from the current index to the end of the array.
Brilliant solution and clear explanation. Thanks!
well explained, with simple algorithm. thank you a lot
This is one of best coding channel
Awesome Sir 😍
Very well explained. Thank you
This is a wrong solution in case of 1 2 3 4 5 Correct o/p will be 2 3 4 5 5 but according to his solution it will be 5 5 5 5 5 .
we need to use stack to reduce the time complexity to O(n).
It is better to see the video again. You have totally misunderstood the algorithm
In the case of 1 2 3 4 5 correct output would still be 5 5 5 5 5. Because you have to choose the largest number in the array. Please see the video again as the guy has explained with perfection
Yes this is wrong we have to use stack for it
if change swap the 7 and 15 like that 3,4,20,6,7,2,1,15 then it will give wrong NGE for 6 as 15 which is actually has to be 7.
[20,20,20,15,15,15,15,15] is the correct answer.
Please make a video about time complexity.
excellent stuff, please continue to upload content. :)
I have a Binary Search Tree with the addition that each node is colored Red or Black (it is not a Red Black Tree). I'm writing methods to determine if the given BST is a valid Red Black Tree (all Red Black Tree properties are met). The only method I cannot figure out is the property that any path from any node to any null node contains the same number of black nodes. Any suggestions?
You're damn good teacher!!
best, thank you bro
sir can you make a vedio on matrix in place rotation
Thanks Sir ...what happend to duplicates -- 7 . 7 . 15
please put a video on snake and ladder problem
Sir if u don't mind u can make videos of programming of scheduling algorithm...
If possible please upload parallel binary search
Hi Sir,
I want to learn data structures and algorithm in Python language. What measures can be taken? And where do I start? I would like to discuss this with you personally if you don't mind.
I don't think this is a correct solution. For the case [ 6, 7, 3, 8] the output will be [8, 8, 8, 8] while the correct output will be [7, 8, 8 , 8].
Please correct me if I am wrong.
[8,8,8,8] is the correct answer.
The correct answer is [8, 8, 8, 8] because 8 is the maximum element in the array and it is the rightmost one.
yes the solution is wrong
@@lakshsrivastava5751 this question not about next greater element, its about next greatest element
@@lakshsrivastava5751 it is asking for next greatest element not next greater element. Next greater element is tough though
Please add Travelling sales man problem
thanks a lot!
Could you please make a video on wine problem for dynamic programming not able to understand .As there are no resources.Pls sir
SIR NEW VIDEOS????
Next greatest element for 3 is 4..isn't it?
No. 4 has been replaced by 20
3 should be replaced by 4
You have totally misunderstood the algorithm. Watch the video again to understand the working of the algorithm
please make a video reagrding N Queen Problem of backtracking. I cannot understand properly. Please help me in this one sir. Thanking you
Yes sure....will make the video in this week
Sir pls write complete program
totally wrong code..it wont run for example like 1 2 3 4,. here correct output will be 2 3 4 -1 but your code will give 4 4 4 -1
The correct output is 4 4 4 4. The comparison is made with the whole array from that particular element till the end of array. Anything greater in that portion is selected. See the video again so that you can understand better.
very nice explanation but this logic is not proper.
i am a great fan of yours, just a small piece of advice, please cross check the solutions you provide, this solution is wrong, and a couple more of your solutions are wrong from other videos
Can you please explain why it is wrong? I don't see any mistakes.
it is wrong...
@@nickjames2059 No, his algorithm is correct. The title of the video may be causing some confusion. The goal is to replace the integer at the current index with the highest integer in the subset of the array from the current index to the end of the array.