Great video. One very important point I realized that for finding mid we should use start + (end -start)/2 instead of (start + end)/2. This will help to handle int overflow error when array is big.
@ankitranjan883 жыл бұрын
Thank you ... you are doing great job for us...smoothly explained even all the smallest term to heighest term...
@swastikkanjilal28294 жыл бұрын
Sir you are great in explaining these concepts!
@fathimasyed42324 жыл бұрын
Thank you so much .. Really helpful .. Slow and steady, so it is understandable even for beginners..Thanks a lot.
@MargulanTukhfatov4 жыл бұрын
Please continue posting videos, very good explanation
@praveenchouhan63884 жыл бұрын
awesome explaination!!!!!!!!!!!!!!
@munishkumararora64295 жыл бұрын
Great explanation for pivot element. Thanks
@SunilKumar-cu8wm5 жыл бұрын
Hi Vivekananda, please change the condition where a[s] > a[mid] here it should be a[s] < a[mid] to select the portion from "s" to "m-1"
@nishantsaxena75005 жыл бұрын
nahi brother , it is right .. recheck it bro..thoda ghumakar likha h .. par sahi hai..
@payalsagar18084 жыл бұрын
@@nishantsaxena7500 I agree with sunil
@maheswarreddyu6 жыл бұрын
will this algorithm work when the array has either 1 or 2 elements?
@mikelee56917 жыл бұрын
thanks. can you please do serialising/deserialising a string to a binary tree?
@akyt75955 жыл бұрын
Great explanation sir. Thank you!
@ManishaKumari-yv3nf4 жыл бұрын
Thanks😊 for the effort ur putting in. They're very helpful
@karthikk11725 жыл бұрын
Great Explanation. Never stop making videos.
@payalsagar18084 жыл бұрын
Thankyou Vivek ! great 👌got it
@duredurrani4 жыл бұрын
Nice explanation
@priyaranjanPanda935 жыл бұрын
Do mention also , how to go about duplicate elements in the array. Nice explanation anyways !!
@LakshyaK_SE_3 жыл бұрын
is this code correct when we have duplicate elements in a array?
@sammanluitel30187 жыл бұрын
. Given a binary string (e.g. 01, 101, 011), in each iteration 0 becomes 01 and 1 becomes 10, find kth character in the string after nth iteration simple approach, time complexity, express time complexity in terms of n only efficient approach, explanation, time complexity. can u please make a video to solve this problem
@FactifyFables12344 жыл бұрын
try to give clear description sir
@RahulKumar-qu1if4 жыл бұрын
Thank you sir!
@sravankumar47506 жыл бұрын
can u make a video on shuffle a deck of cards in array or randomize a given array
@lokeshsistu99963 жыл бұрын
Sir please make videos on timecomplexity
@gayatrijoshi59514 жыл бұрын
You are amazing man🙌🙌👏👏
@Dragondavid6 жыл бұрын
You are the best
@helloyou42336 жыл бұрын
i like your videeeos sir... plz keep making videos
@bhaskarnaik58422 жыл бұрын
Thanks
@yuanhe98906 жыл бұрын
Thanks, I've always looked at ur utube explanations. They are great and saved me a lot of effort. But please have a better mic LOLOL
@nidhisingh25_4 жыл бұрын
thank you
@isonal20997 жыл бұрын
Vivekanand ji. There is no link in description bar of this video.
@vivekanandkhyade3 жыл бұрын
I will put it.
@karthikperavelli17355 жыл бұрын
A[]={16,15,14,13,12,11,10,8,7,6,3,2}; what if i pass this extreme case, it returns (m+1), while ans is 11 ??
@avinashkaushik23133 жыл бұрын
owsome
@amandeepchilani39995 жыл бұрын
Great Job Vivek..
@Shini19844 жыл бұрын
What if arrays contains duplicates?
@knightganesh7 жыл бұрын
Hi the video is awesome and super easy to understand, keep it going. Small suggestion : - But kindly record with a better mic as there seems to be lot of noise in the background.
@vikrantkumarsmvdu6 жыл бұрын
Hi Vivekanand, Please upload videos on different sorting algorithms.
@Saurabhnaik7 жыл бұрын
Thanks a lot for great explanation. Please make a video on removing duplicate elements from Array Thanks in advance...
@SEVERANCE8507 жыл бұрын
implementation of heap
@pankajverma8924 жыл бұрын
Let us assume that m came 8 than algo will not work bro....
@rrsonia105 жыл бұрын
whats space complexity?
@dhruvajuloori43616 жыл бұрын
Finding an element is nothing but finding a minimum element in the array
@bhavyanayyer33914 жыл бұрын
sir can u pls provide with a code it will be very grateful
@FactifyFables12344 жыл бұрын
sir please include in python language please sir
@tyler_ua65936 жыл бұрын
And space complexity is O(n) -> for recursive call stack.
@piyushpatelsrm6 жыл бұрын
boom
@bhavyanayyer33913 жыл бұрын
#include using namespace std; int findindex(int s ,int e,int arr[]) { int m = s+e/2; if(arr[m]>arr[m+1]) { int pivot; pivot=m+1; return pivot; } else if (arr[s]>arr[m]) { findindex(s,m-1,arr); } else { findindex(m+1,e,arr); } } int binarysearch(int s , int e ,int arr[], int ele) { int mid = (s + e)/2; while (s
@AshishShukla66 жыл бұрын
Good explanation but speed in too slow, many repeatation, 10 to 15 min is sufficient
@tyler_ua65936 жыл бұрын
You can increase the speed of the video. By clicking on the wheel on the right bottom
@harsh40025 жыл бұрын
m = s + (e-s)/2
@SimplyByNP5 жыл бұрын
Harsh Baheti can you explain why this way is better than (s + e) / 2
@ajay06bce0124 жыл бұрын
Play at 1.5 times the speed and thank me later!
@adityavashisth4956 жыл бұрын
wrong approach: cant solve even simple test cases. Suppose if my array is: 9,12,15,1,2,38,40,42,22,45,50,55. Now according to your algorithm mid index is 5 here and arr[s]=9 < arr[m]=38 , so according to your algo it will move to else part and search for PIVOT after 38. But PIVOT is arr[4] which is before 38. So wrong approach.
@varunrao33495 жыл бұрын
this isn't a sorted rotated array
@ShujathHussain05 жыл бұрын
take a circular sorted array and play using the algorithm
@lachlangro4 жыл бұрын
@@varunrao3349 I agree. It has two pivots. 9 and 1 at indexes 0 and 3 respectively.
@lachlangro4 жыл бұрын
His algorithm is not foolproof as is. It should first check the start element against the end element to detect whether the array is simply a sorted array with no rotations. It can also fail in situations where duplicates exist such as: 5, 1, 3, 5, 5, 5, 5, 5, 5, 5, 5. keep in mind that i could have placed the 1, 3 in either half of the array. In cases like this linear search may have to be used.