Each and every video the explanation is very good. But I'm getting confusion about time and space complexity. for question no.(44-46), as per my understanding time complexity is O(n2)-(2 loops). I'm confused because it is O(n).I want to get a clear understanding of "Time& Space complexity". Please address my doubt
1. Could you please explain why Arrays program no.44's time complexity is O(n) and why not it is O(n2) because it is having 2 loops? 2. When time complexity is the same for the below 2 programs, what is the better approach and why? Arrays 44: ua-cam.com/video/Ye87Z472M3k/v-deo.html Arrays 11: ua-cam.com/video/9al_CQEksVA/v-deo.html
Find the closest number in array consisting of positive and negative number. Ex -4,-1,0,2,4,10and target 30 output 10 ... If possible
Ok, I'll try to do it. It can be implemented using Heap. We can find upto k closest. In your case k = 1. Will try to add this video soon.
@@CodingSimplified Yes ,it can be solved using binary search . Want to understand multiple approaches
good explanation keep uploading new videos...
Thanks. Keep Watching.
Each and every video the explanation is very good. But I'm getting confusion about time and space complexity. for question no.(44-46), as per my understanding time complexity is O(n2)-(2 loops). I'm confused because it is O(n).I want to get a clear understanding of "Time& Space complexity". Please address my doubt
1. Could you please explain why Arrays program no.44's time complexity is O(n) and why not it is O(n2) because it is having 2 loops?
2. When time complexity is the same for the below 2 programs, what is the better approach and why?
Arrays 44: ua-cam.com/video/Ye87Z472M3k/v-deo.html
Arrays 11: ua-cam.com/video/9al_CQEksVA/v-deo.html