8.2 Searching in Arrays | Linear and Binary Search | C++ Placement Course |

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 1,2 тыс.

  • @kiranp5828
    @kiranp5828 4 года назад +19

    These guys are just amazing.And they were doing such a great work.
    They were giving a very quality education for free.
    Please guys support them all.🙏🙏🙏

  • @Csharpian.
    @Csharpian. Год назад +2

    Mam you are really god for us, likes poor and middle class background students
    Your technique of teaching is just amazing
    your video makes easy to understand any topics...tqqqq my fav mam

  • @severemage3374
    @severemage3374 2 года назад +69

    0:49 linear search
    3:30 binary concept
    8:00 binary code

  • @sagarrajkumargupta5168
    @sagarrajkumargupta5168 2 года назад +23

    your teaching style is quite good and i want notes of this lecture. i saw previous request for notes But you didn't upload on this video.
    kindly upload the notes as soon as possible its my humble request to you. Keep Growing.

  • @CricketLover-kc6ln
    @CricketLover-kc6ln 4 года назад +172

    Man with the mission 🔥🔥🔥❤️

    • @jaiveer9306
      @jaiveer9306 4 года назад +8

      Like Elon musk 👻😉🤣🤣🤣

    • @CricketLover-kc6ln
      @CricketLover-kc6ln 4 года назад

      @@jaiveer9306 😀😂

    • @pep8221
      @pep8221 4 года назад

      @@CricketLover-kc6ln Tera aukat bhi nahi h Sharda jaise prestigious university me admission lene ka

    • @pep8221
      @pep8221 4 года назад

      @@CricketLover-kc6ln Tera aukat bhi nahi h Sharda jaise prestigious university me admission lene ka

    • @Shubham-rv5cm
      @Shubham-rv5cm 4 года назад +1

      Man on mission

  • @sanketkumar09
    @sanketkumar09 4 года назад +27

    Well done bhaiya
    We love you and always support you

    • @pep8221
      @pep8221 4 года назад

      Tera aukat bhi nahi h Sharda jaise prestigious university me admission lene ka

    • @ashisharyan3028
      @ashisharyan3028 4 года назад

      @@pep8221 good joke bro .... sharda prestigious h

    • @pep8221
      @pep8221 4 года назад

      @@ashisharyan3028 yesss very much. Even more prestigious than Harvard.

    • @ashisharyan3028
      @ashisharyan3028 4 года назад

      @@pep8221 lol bhai meri toh fir aukaat hi nhi h.....merese toh 12th pass hi nhi kiya hoga

    • @pep8221
      @pep8221 4 года назад

      @@ashisharyan3028 koi baat nahi bhai. Agar sharda university me admission nahi hua tho tum koi aur university jaise ki Oxford, Harvard ya Princeton me admission lelena.

  • @astatosiseverywhere
    @astatosiseverywhere 3 года назад +8

    whenever mam say 'thik hai' i feel very good

  • @kpsaini404
    @kpsaini404 3 года назад +8

    Explaining Binary search complexity is awesome. I like it

  • @LifewRoshu
    @LifewRoshu 2 года назад +3

    Thank you so much AMAN BHAIYA and the whole team of APNA COLLEGE ❤️❤️✨✨

  • @amanjaiswal4847
    @amanjaiswal4847 3 года назад +2

    one thing i want to add:
    mere jese slow learner ko jab koi kuch concept samjhaye or fir programme likhne k baad usi chiz ko dubara samjhaye pura
    no words for this
    thank you so much

  • @rutvikrana512
    @rutvikrana512 4 года назад +35

    This approach of problem solving is called
    "divide and conquer". As we are dividing our array into halves.
    Another examples of D&C :
    - finding GCM ( greatest common divisor )
    - merge sort and quick sort algorithms
    binary search will only work if array is sorted. This should be in mind.
    The same example of the video can be easily written by Recursion.
    binarySearch(int arr[],int item,int l, int r)
    {
    int n = sizeof(arr)/sizeof(arr[0]);
    int m = (l+r)/2;
    if (m < 0 || m> n-1){ return -1; }
    if (arr[m] == item){ return item; }
    else if(arr[m] > item) {
    return binarySearch(arr,item,l,m-1);
    }
    else{
    return binarySearch(arr,item,m+1,r);
    }
    return -1;
    }

    • @kushagra0347
      @kushagra0347 4 года назад +1

      What is l and r representing?

    • @fundekaustubh
      @fundekaustubh 4 года назад +4

      @@kushagra0347 l represents the left-most index of the half that is to be searched and r represents the right-most index of the half that is to be searched. Initially while calling the function, l is 0 and r is n-1.

    • @kushagra0347
      @kushagra0347 4 года назад +2

      @@fundekaustubh Thanks Mate💯🙌🏻

    • @be_calm2372
      @be_calm2372 4 года назад +1

      Good ❤️

    • @sohanjangid1207
      @sohanjangid1207 4 года назад

      @@fundekaustubh can we assign first array index as '1' or it is necessary to assign it '0'.
      Here she use n but that mean that she is assigning first value as 1.

  • @couldbenimish
    @couldbenimish 4 года назад +145

    Addition : : Binary Search applicable only when the given array is sorted. If not, we first need to sort the array and then find the element using the binary search function.

  • @SakshiPatil_
    @SakshiPatil_ 4 года назад +4

    Thankyou so much for your efforts ❤️❤️ and urvi di apa bahoot jyada accha sikhate ho please apa hi sikhana ye pura course muze apaka sikhaya jyada accha samajha ata hai . Love you ❤️❤️❤️

  • @GURU-lz1iw
    @GURU-lz1iw 3 года назад +8

    dd, ek baar dekhna... doubt tha...
    time complexity of binary search mein...
    after 3 interation length of array is n/2^3-1... so after k interation it should be n/2^k-1...
    so after calculation time complexity should be log2n with base 2...plz clear the doubt.... btw thanks for the course to every member... lots of love❤❤❤❤

    • @xpt5oo186
      @xpt5oo186 2 года назад

      base is ignored while calculating complexity as log base 2 is same log base e / log base 2 and we ignore the coefficients of terms. Here log base 2 is ignored.

    • @K-EC-AmanKumar
      @K-EC-AmanKumar 2 года назад

      constant to be ignored so K = log n + 1 would be same as K =log n

  • @aestheticsurdu5975
    @aestheticsurdu5975 3 года назад +1

    Watching From Pakistan
    Love this Channel

  • @361-shashankgupta3
    @361-shashankgupta3 2 года назад +7

    Binary Search works in sorted array only.
    We have to sort the array first in ascending or descending order if the array entered in unsorted .
    Linear Search is better for unsorted array

    • @Samconery
      @Samconery Год назад

      why is that the end point is n and not n-1 when we keep the start point as 0?

  • @CyberrBoss
    @CyberrBoss 3 года назад +1

    Your pace and voice is so good, it helps to get understand the concept very easily. Thanks

  • @devilhunter8120
    @devilhunter8120 3 года назад +112

    8:52 the value of e = n-1, because the indexing starts from 0.

    • @jasmeetsinghvirdi77
      @jasmeetsinghvirdi77 3 года назад +5

      Yes even I noticed the same thing.. Kindly update if we are wrong.

    • @aryansaxena4978
      @aryansaxena4978 3 года назад +7

      actually it could be either of the values, cuz vese b hamein exact mid point ki zarurat nhi hai. baad m to check krna hi hai ki key midpoint se bada hai ya chota hai.

    • @hemasingh5668
      @hemasingh5668 3 года назад +10

      No...I think over here because as s=0 and e=n so when you will do (S+n)/2=(0+n)/2 will give exactly half of your array but if you do(0+n-1)/2 you will not get exactly the mid of the array.please think again.

    • @aryansaxena4978
      @aryansaxena4978 3 года назад +13

      @@hemasingh5668 yeah that is true but there is really no need to find out the exact mid point ryt? Lets assume array 6 size ki hai. (0+n)/2 krte ho to mid point 3 index p ata hai. (0+n-1)/2 se mid point 2 index ata h. And in either of the cases u ll be checking whether your target element is before that index or after that index. N time complexity is also the same in both cases. So the answer ll be d same either way.

    • @harshvardhankushwaha3000
      @harshvardhankushwaha3000 3 года назад +6

      gives same result either

  • @priyamondal6177
    @priyamondal6177 3 года назад +12

    Best video ever.
    Thank you mentor and Aman dhattarwal for this awesome contribution to the society. More power to all the members of Apna College.

  • @tathagata_ghosh_14
    @tathagata_ghosh_14 4 года назад +37

    Urvi di rocks man!!!🔥🔥🔥❤️

    • @vishalprajapati1208
      @vishalprajapati1208 3 года назад +1

      Bhai madam ka pura name or insta account ho to do na , please 🙏🙏

    • @21ishansharma82
      @21ishansharma82 3 года назад

      @@vishalprajapati1208 urvi goel!

  • @SUJOYPAULJOBS
    @SUJOYPAULJOBS 4 года назад +1

    linear and binary search bohot easy ....and MAM EASY TO TEACH C++...NICE

  • @aryansharma-wf8sn
    @aryansharma-wf8sn 4 года назад +4

    Urvi di aap hi baki lectures bhi lena you explain these concepts very easily 🤩😍

  • @priyanshuadhikary8915
    @priyanshuadhikary8915 4 года назад +12

    There is one mistake in last time complexity that after K iterations ,the length of the array becomes = n/2^(k-1)........(12:17)...
    I hope , I am right since you are a wonderful teacher and because of you I can find the mistake and can correct it.....

    • @jatinkumar-bd2nw
      @jatinkumar-bd2nw 4 года назад

      You are right brother

    • @bdbrightdiamond
      @bdbrightdiamond 4 года назад +4

      No the mistake is at first line, after first iteration length of the array becomes n/2 and not n

    • @snehilsinha4689
      @snehilsinha4689 4 года назад +6

      there's no mistake at all. The array size starts from n and after the iterations start, it becomes n/2, n/3, n/4... n/2^k. Note here that k is a random number and not according to the pattern you are thinking which makes it (k-1). Let's say (k-1)=k'. In the video k' is the k. You can co relate this with principal of mathematical induction where we assume the expression to be true for any random k and not some k as per some pattern.
      And for those who are saying after first iteration array size should be n/2, that's true but the point is that we have to consider from the point before the iteration starts for calculation of time complexity in which case the size wil be n itself.
      So apparently there's absolutely no mistake in the video.

    • @SudeepJoshi22
      @SudeepJoshi22 4 года назад

      @@bdbrightdiamond That's Correct...👍👍👍👍👍👍👍

    • @prashantdeveloper7354
      @prashantdeveloper7354 4 года назад

      @@snehilsinha4689 you r right...
      But it should be n/2,n/4,n/8....

  • @bengaltiger3890
    @bengaltiger3890 4 года назад +113

    Everyone is first until you refresh 😂🔥

    • @arunmaity461
      @arunmaity461 4 года назад

      Han..ekdom😂

    • @pep8221
      @pep8221 4 года назад +1

      Tera aukat bhi nahi h Sharda jaise prestigious university me admission lene ka

    • @pep8221
      @pep8221 4 года назад

      @@arunmaity461 Tera aukat bhi nahi h Sharda jaise prestigious university me admission lene ka

    • @arunmaity461
      @arunmaity461 4 года назад +2

      @@pep8221 tum kon hote ho..mera aukad judge karne wala? Aur maine aisa kya comment kiya jisse tum mera aukad estimate karoge?

    • @arunmaity461
      @arunmaity461 4 года назад +3

      @@pep8221 aur aisi arrogant stupid idiot ki tarah behave mat karo..isse tumhara khud ka hi respect girega dusro ke saamne..tumhare mata pita kya is tarike se tumhe logo ke saath behave karna sikhaya hai?

  • @haseeburrehman4212
    @haseeburrehman4212 2 года назад

    Your teaching style and voice is quite good.

  • @RiyaSharma-gm5om
    @RiyaSharma-gm5om 4 года назад +19

    Truly amazing content, I just love this series.

  • @oli1346
    @oli1346 4 года назад +6

    This video is well animated and explained nicely! please follow this order

  • @rajgupta6521
    @rajgupta6521 4 года назад +6

    After k iteration ,length of array=n/2^k-1
    As
    In 1st iteration length =n/2^0
    In 2nd iteration length =n/2^1
    So
    In k iteration length =n/2^k-1
    It is simple gm series

    • @tulsidas2908
      @tulsidas2908 3 года назад +1

      Exactly

    • @chiragsharma5387
      @chiragsharma5387 3 года назад +2

      1st iteration ke baad n/2 hoga kyuki phli baar jab function run hoga to (s + e)/2 se run hoga, so kth iteration n/2^k hoga

    • @sagardas2924
      @sagardas2924 3 года назад

      Yess! Toh pehle n hi hain array size. First iteration ke baad n/(2^1) and so on!

  • @PrithaMajumder
    @PrithaMajumder Год назад +1

    Thank You So Much Apna College for this amazing lecture 😊

  • @tayyabali3604
    @tayyabali3604 2 года назад +3

    Thank you very much for this DSA course very easy and simple way to learn

  • @shivammishra9733
    @shivammishra9733 2 года назад

    This is a best course of C++ and DSA

  • @hifzahabid8554
    @hifzahabid8554 2 года назад +4

    you way of explaining things is awesome but just try to explain even more deeper because we are beginners

    • @unkownboy9962
      @unkownboy9962 2 года назад

      🙂han na aksar cheezay uper sy he guzer jati hai

  • @talkwithrd5697
    @talkwithrd5697 4 года назад

    Great... Kisi ne itna easily nai samjhaya
    Thank @apnacollege

  • @prathitprasad
    @prathitprasad 2 года назад +6

    I use Java but still this explanation was too helpful
    Btw no Nehas were harmed while making this video

  • @mr.techoorienter
    @mr.techoorienter 3 года назад

    Aman bhaiya = indian elon musk in education..❤️🔥🔥🔥

  • @VikasSingh-pw5iz
    @VikasSingh-pw5iz 3 года назад +6

    Are ye didi konsi h, she explains really well. Thanks for the efforts

  • @tejasvitarone5586
    @tejasvitarone5586 3 года назад +14

    Very Important condition for Binary search is that Array should be sorted But in your code there aren't any lines which shows that.if before searching we code for it then it will be better for unsorted input array also.

    • @nishant9847
      @nishant9847 2 года назад +1

      hnn we can write a seperate function for that

    • @MtlbKuchBhi121
      @MtlbKuchBhi121 2 года назад +1

      Because she already has taken sorted array from user.

  • @mukundkumar3400
    @mukundkumar3400 3 года назад +6

    I always forget about hitting the like button nevertheless I love this series

  • @GeshuLin_WW
    @GeshuLin_WW 3 года назад +15

    After K iteration, the length of the array should be n/2^k-1

    • @nikunjgaming9590
      @nikunjgaming9590 3 года назад

      Yes

    • @techeduidea2598
      @techeduidea2598 3 года назад

      Yes

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 года назад

      ruclips.net/video/5FsIa4Mp3ho/видео.html

    • @ayushdey6503
      @ayushdey6503 2 года назад

      Same doubt

    • @gagaguguu
      @gagaguguu 2 года назад

      It doesn't matter. Its like subtracting infinity by 1
      So
      infinity - 1 = infinity
      So
      N/2^k-1 = N/2^k
      Because N is dominant and can be value equal to infinity

  • @abhijeetdhumal8650
    @abhijeetdhumal8650 3 года назад

    I think we need to write while loop like
    while(s

  • @adityadeepak5686
    @adityadeepak5686 4 года назад +36

    didi saying "thik hai" is op !!!

  • @barfy.man3624
    @barfy.man3624 4 года назад +1

    Kya mast Kam krte ho maksood bhai

  • @saudaminisahu9060
    @saudaminisahu9060 2 года назад +3

    @Apna college The length of array after k iterations would be n/2 power(k-1) (in the concept of finding time complexity of binary search)

    • @ManognaThota
      @ManognaThota Месяц назад

      i think iteration starts from 0

  • @thats_me_ds
    @thats_me_ds 11 месяцев назад

    i would like to point one specific error, lets say we putted one sorted array and key is same as the last value of array, then it will return -1 because we have initialsed last element e from n, it would be better if we initialise [e= n-1]. In the function defined 'binarysearch', we need to initialize the end from n-1 where n is the size of the arr. I hope this helps.

  • @beacoder1221
    @beacoder1221 4 года назад +75

    Sir Please upload the notes it is going to be 1 week of this video being uploaded

    • @weasleygaming3
      @weasleygaming3 3 года назад +2

      Can you please tell at 5:57, it isn't necessary that the user inputs the elements of array in ascending, so how can we solve it then?

    • @TonyStark-ct8xd
      @TonyStark-ct8xd 3 года назад +2

      @@weasleygaming3 use c/c++ built in sort( ) function.

    • @0xatul
      @0xatul 3 года назад

      @@weasleygaming3 Yes, It's necessar to have the inputs in ascending order, thats why it is called binary search. There are other algorithms for searching without a ascending order.

    • @cenacr007
      @cenacr007 3 года назад

      u can sort it beforehand....sort function is available for that

    • @AbhishekSharma-wi2ry
      @AbhishekSharma-wi2ry 3 года назад +1

      @@TonyStark-ct8xd by after sorting the array index of the elements will change then how would we get correct index
      It will index of the sorted array but we want index of the real array that's my doubt

  • @ishitabisaria6437
    @ishitabisaria6437 4 года назад +26

    Sir notes??

  • @EverythingaboutTechPro
    @EverythingaboutTechPro 4 года назад +5

    The time complexity of Binary search is not really O(logn ) because the array was not sorted . SO if i have to sort the array as well using Merge Sort then the time complexity becomes O(logn + nlogn) = O(logn) ... So if it's unsorted then time complexity is O(nlogn) .

  • @kritikamishra5023
    @kritikamishra5023 3 месяца назад

    just loved the explanation

  • @jatingarg1897
    @jatingarg1897 4 года назад +20

    Sir please provide the notes of this lecture sir. Thankyou. And your course is amazing.

    • @rakeshpatra7800
      @rakeshpatra7800 2 года назад +1

      Re ghanta amazing vai sala wise parata hai jaise ki aj hi khatam karna hai pura syllabus ☹️ thoda smjha samjha ka padya na
      College mai vi eisa padata hai or yeh vu dise padata hai 😑kahase samjhe patahi nahi chalta hai

    • @jatingarg1897
      @jatingarg1897 2 года назад

      @@rakeshpatra7800 Check the time of my comment. Its more than 1 year now. Ab isse kahi guna behtr courses youtube pe hai.

  • @AryanSingh-xx8lc
    @AryanSingh-xx8lc 2 года назад

    Ma'am ki awaz se pyaar ho gya

  • @rajeshjha6801
    @rajeshjha6801 4 года назад +7

    Bandhubud aur budbak me apna school tha
    AUR yaha pe apna college😍❤❤

    • @pep8221
      @pep8221 4 года назад +3

      Tera aukat bhi nahi h Sharda jaise prestigious university me admission lene ka

    • @me-oniichan
      @me-oniichan 4 года назад +1

      @@pep8221 kahi bhi kuch bhi likh rha hai kya tu

    • @puneetchhabra2578
      @puneetchhabra2578 4 года назад

      @@me-oniichan ye spam krra h pgl

    • @rajeshjha6801
      @rajeshjha6801 4 года назад

      @@puneetchhabra2578 haan

  • @vengersquad8912
    @vengersquad8912 2 года назад

    It helped me a lot for my boards exam of computer

  • @srijankunduchowdhury
    @srijankunduchowdhury 2 года назад +3

    After 1st iteration, length of array should be n/2 ..
    That's why we can conclude,
    After k iteration, lengh of array would be n/(2**k)

  • @dm01417
    @dm01417 3 года назад +3

    That "Theek Hai" hits on another level also kya awesome bandi ha yrr as in your voice is very sweat. Buddy Loved the way you teach xD xD !!

  • @excalibur2889
    @excalibur2889 4 года назад +20

    Didi afer kth iteration shouldn't it be n/(2^k-1)

    • @nimisharaj8501
      @nimisharaj8501 3 года назад +1

      yeah..i too had the same doubt..

    • @ibrahimwadi6539
      @ibrahimwadi6539 3 года назад +1

      @@nimisharaj8501 same here

    • @akshansharma3527
      @akshansharma3527 3 года назад

      after the first iteration, it will be n/2.
      it will be n before that.
      so the formula is n/(2^iterations)

  • @hspianozone1337
    @hspianozone1337 4 года назад

    Sab samaj aa gaya now I am confident about c++

  • @vidhutripathi4871
    @vidhutripathi4871 4 года назад +45

    end should be set as n-1 since we have 0 based indexing in c++

  • @shubhambhardwaj8894
    @shubhambhardwaj8894 4 года назад +5

    Awesome lecture, thanks ma'am❤😊

    • @dipanshi1588
      @dipanshi1588 3 года назад +2

      0:47 agar nahi milega to minus 1 kyu karna hai return..?

  • @abdurrehmanali3851
    @abdurrehmanali3851 3 года назад +30

    There is mistake in finding time complexity of binary search. After 1s iteration our array size has reduced to half but in video they took full size of array .
    This is the correct form of solution
    Time complexity:
    After 1st iteration ,lenght of array = n/2
    After 2nd iteration ,lenght of array = n/4
    After 3rd iteration ,lenght of array = n/8
    After 4th iteration ,lenght of array = n/16
    After kth iteration ,lenght of array = n/(2)^k

    Let length of array becomes 1 after kth iteration
    n/(2)^k = 1
    n= 2^k
    log2(n) = k log2(2)
    k = log2(n)
    Time complexity = log2(n)

    • @zishanali9461
      @zishanali9461 2 года назад

      F bro even on GFG they have also given the wrong soln

  • @ehsanullah4206
    @ehsanullah4206 11 месяцев назад

    Very easy teaching method thanks maam

  • @subhamrudra360
    @subhamrudra360 3 года назад +29

    Sir, it has been 8 months now, please upload the notes of this video. 😃

  • @nainika.s6572
    @nainika.s6572 4 года назад

    Well done bhaiyah you are the best and your whole team is also best

  • @kunal1898
    @kunal1898 3 года назад +3

    Shraddha Di.. you rock🔥

  • @last_countr_
    @last_countr_ 4 года назад +3

    Level of explanation aag aag aag 🙏

    • @SonalDhani
      @SonalDhani 4 года назад +1

      Konse angle se

    • @last_countr_
      @last_countr_ 4 года назад +1

      @@SonalDhani animation ke angle se🤣🤣🤣🤣

  • @shreyaschavhan5522
    @shreyaschavhan5522 3 года назад +356

    Notes -
    Linear Search - {Time Complexity - O(n)} - 0:49
    Binary Search - Concept - 3:30
    Binary Search - Code - 8:00
    Binary Search - Time Complexity - O(logn base 2) - 11:32

    • @shreyaschavhan5522
      @shreyaschavhan5522 3 года назад +4

      @@ThunderBladeZen Hum har jagah par hai 😁! Ashirwad bhava

    • @singh_04
      @singh_04 3 года назад +2

      where is neha search ?

    • @shreyaschavhan5522
      @shreyaschavhan5522 3 года назад +10

      @@singh_04
      Neha Search - Concept: Sabka Katega
      Neha Search - Time Complexity: 6 to 12 months
      Neha Search - Conclusion: ____________! (Fill in the blank)

    • @manitsaharan5995
      @manitsaharan5995 3 года назад +4

      Bhai ye code glat h chal hi ni mera binary search wala

    • @shreyaschavhan5522
      @shreyaschavhan5522 3 года назад +1

      @@manitsaharan5995 Correct hai Bhai! Ek baar phirse dekho kuch mistake ho rahi hogi apse

  • @AK-ln2ko
    @AK-ln2ko 2 года назад

    Time complexity of binary search is O(log(base2)N)
    and for linear search is O(N)

  • @rakeshkumar015
    @rakeshkumar015 3 года назад +24

    12:11 --After k iteration,i think length of array becomes n/2^(k-1)🙄🙄🙄

  • @harshulagarwal1755
    @harshulagarwal1755 4 года назад

    Bhaiya ads daal dete vids mein. Kam se kam kuch support toh milta hamaari taraf se. Thank you so much for this course 🙏🙏👍👍

  • @vaibhavkapoor3953
    @vaibhavkapoor3953 3 года назад +50

    Pls upload notes of this video it’s been 3 months now🙏🏼

  • @armedgamer3636
    @armedgamer3636 2 года назад +1

    Hi apna college.
    Amazing video you have made here, full of learning.
    Please can you upload notes for this video??
    Regards

  • @THEELECTRICGUY
    @THEELECTRICGUY 4 года назад +6

    There is a small mistake in the video;
    In the function,
    variable e should be initialized with (n-1) rather than n
    If you run the program and enter a value greater than the values you have given to the array then you will not get -1 rather you will get the same number as an output!!! which is weird...

  • @anubhavjha08
    @anubhavjha08 11 месяцев назад

    Notes of this video will be uploaded in a short while :)
    PLEASE UPDATE ???

  • @dexhorox7394
    @dexhorox7394 Год назад +2

    You forgot to mention one thing though while linear search can be used on unsorted data,binary search can only be used on sorted data

  • @brucewayne-mh7ul
    @brucewayne-mh7ul 3 года назад

    Gazab animation bhai 😁

  • @somnathduttabanik5048
    @somnathduttabanik5048 3 года назад +3

    please upload the notes...
    thank you for the lecture series

  • @Hot-Introduction
    @Hot-Introduction 4 года назад

    Aman Bhaiya and team you are great

  • @mihirmakwana1141
    @mihirmakwana1141 4 года назад +7

    Sir please upload notes of this video.

  • @shivammaurya3451
    @shivammaurya3451 4 года назад +1

    Thank u aman bhaiya and mam very useful video thank u ❤🖤

  • @sohamDevRel
    @sohamDevRel 4 года назад +10

    When would the notes be uploaded?

  • @cs-oi4im
    @cs-oi4im 3 года назад +2

    Size of array should be a constant number and should be given at compile time.
    int size=5;
    int arr[size]; //it generates error
    int arr[5]; //works fine
    I don't know why her compiler didn't generate any error when she wrote arr[size].
    If i am wrong then please correct me

    • @AbdulWahab-fk9yf
      @AbdulWahab-fk9yf Год назад

      she is using mac that's why
      In windows we have to give an integer value of size at time of declaration

    • @cs-oi4im
      @cs-oi4im Год назад +2

      @@AbdulWahab-fk9yf Maybe, it's because of IDE too

  • @sounaksaha1455
    @sounaksaha1455 3 года назад +12

    Please, bhaiya upload the notes ASAP. We are counting on you

  • @nn_yt24
    @nn_yt24 3 года назад +1

    In time complexity of binary search after k iterations length of array should be n/(2^k-1)

    • @shrey8504
      @shrey8504 3 года назад

      No, as during the first iteration length of array will be n/2 (instead of n) ,the length of array for kth iteration will be n/(2^k)

  • @alimemon3054
    @alimemon3054 4 года назад +5

    Bhaiya Everyday I am waiting for you to upload the video...Bhaiya the link in the notes of last video is not opening

  • @akshitshah5575
    @akshitshah5575 2 года назад

    s - starting index of an array
    e - ending index of an array
    Array index range is from 0 to n-1. So ideally, e should point to n-1. In this case, e=n, and if I try to access arr[e] will get garbage data.

    • @raushanraj9597
      @raushanraj9597 2 года назад

      ya bro i didn't understand how they able to run false code,,hahahah

  • @rutvikrana512
    @rutvikrana512 4 года назад +12

    Why use binary search??
    Simple answer:
    If n will become very large then simple search will take hours to find element, but same with binarysearch becomes log(n) ( aka in seconds ... ) 👌

    • @me-oniichan
      @me-oniichan 4 года назад +1

      Not hours

    • @_rahulsain
      @_rahulsain 4 года назад +1

      there are advance sort also

    • @MintuKumar-dn4gq
      @MintuKumar-dn4gq 4 года назад +1

      because of time complexity.

    • @rutvikrana512
      @rutvikrana512 4 года назад

      ALLEN A ... I am talking about n as big as billions. If we theoretically calculate it will take hours or days. 🤘

    • @rutvikrana512
      @rutvikrana512 4 года назад

      Rahul Sain .... what is that I don’t know ?
      Sort or Search ??

  • @ItsYourCandyBro
    @ItsYourCandyBro 3 года назад

    These videos are really "awesome"

  • @0xatul
    @0xatul 3 года назад +6

    Why do we even need to calculate Time Complexity?
    Is it asked in some interviews? Or is it just for our own understanding and for understanding the call stack?

    • @sit33darshanpagar16
      @sit33darshanpagar16 3 года назад

      We find time complexity to make our program fast

    • @ganeshmurmu2338
      @ganeshmurmu2338 3 года назад +2

      Bhai ek baar competitive websites use karke dekh sara jawab mill jaeyga, time complexity kyu zarure hey,
      Bohot jarure hey bhai!!!!!!!

    • @sayantaniguha8519
      @sayantaniguha8519 3 года назад

      @@ganeshmurmu2338 link bhej tu aur bta teko aisa kyu lagta ?

    • @ganeshmurmu2338
      @ganeshmurmu2338 3 года назад

      @@sayantaniguha8519 dekho, simplest bhasa mey boley to, competitive coding websites mey difficult questions mey O(n) time complexity wala solution banana parta hey isley time complexity is important

    • @ganeshmurmu2338
      @ganeshmurmu2338 3 года назад

      Agar samjh nai aya to ek watsapp group banatey hey? Or if yo don't want to share number than telegram group, accha discussion, doubt solving ho payega.....
      What do you think?

  • @anubhabsamanta8532
    @anubhabsamanta8532 4 года назад

    Bhaisaab
    Kya samjha diya
    Neha rocks

  • @shashankrana1807
    @shashankrana1807 2 года назад +6

    now we have 3 different ways of denoting an array: while in function-array[], while declaring array[n] and while calling in linearSearch- just array. What is logic behind this? Why dont we need to specify size of array while declaring

  • @deepchoudhury2001
    @deepchoudhury2001 3 года назад +1

    Bhaiya please upload the notes ... Thank you so much for a great help bhaiya.

  • @rydhamkerni1466
    @rydhamkerni1466 3 года назад +5

    In C I was taught that the size can't be declared during runtime . Is it allowed in C++ ?

  • @jarjarbinks9937
    @jarjarbinks9937 2 года назад

    unlike C, in C++ by default for every user input the line control shifts to the next line, unless it is an array and inline and equally spaced inputs can be taken.

  • @mrp3443
    @mrp3443 4 года назад +4

    Please also make a video on logarithm. And also this course is just fantastic

    • @parasmoharle
      @parasmoharle Год назад

      Bro if u dont know anything about log just learn basic or mid and then come back same for derivation and integration

  • @rishikoiri2
    @rishikoiri2 10 месяцев назад

    your voice is so good

  • @deepaklavate4165
    @deepaklavate4165 4 года назад +4

    Efforts appreciated ❤❤
    But can you tell me why is this technique named "Binary"?

    • @suraj_chaudhary143
      @suraj_chaudhary143 4 года назад +2

      Because there is a comparison after half of the array ..of mid term and key...it may be true (1) and false(0)..
      i.e binary..

    • @sayanghosh6996
      @sayanghosh6996 4 года назад +1

      @@suraj_chaudhary143 lol no thats not the reason. Its called binary search because in every step the array is being divided into two(bi) parts.

    • @weasleygaming3
      @weasleygaming3 3 года назад

      Can you please tell at 5:57, it isn't necessary that the user inputs the elements of array in ascending, so how can we solve it then?

    • @rameshmalhotra9525
      @rameshmalhotra9525 2 года назад

      ruclips.net/video/5FsIa4Mp3ho/видео.html

  • @ShivaKumar-y1k5z
    @ShivaKumar-y1k5z 7 месяцев назад +2

    Shraddha mam speaking so sweetly..😂 ... I am watching this video on 31/03/2024 ...❤

    • @ayushiydvKG
      @ayushiydvKG 3 месяца назад

      yess shocking kinda 😂

  • @AryanKohli-hkscx
    @AryanKohli-hkscx 3 года назад +6

    12:11 it should be n/(2^(k-1))

  • @Monikakumawat-k4v
    @Monikakumawat-k4v 10 месяцев назад +1

    It is very easy for me😊

  • @TheZipzapzum
    @TheZipzapzum 4 года назад +4

    Yes , neha is back !

  • @ujjwalverma2870
    @ujjwalverma2870 2 года назад

    I AM SO OBSESSED WITH NEHA😌