Maximum Length Bitonic Subarray | GeeksforGeeks

Sdílet
Vložit
  • čas přidán 12. 05. 2016
  • Explanation for the article: www.geeksforgeeks.org/maximum-...
    This video is contributed by Harshit Jain.

Komentáře • 16

  • @tusharsaxena8239
    @tusharsaxena8239 Před 3 lety +5

    bhai ye toh hume bhi dikh rha hai kya kar rhe hai, ye batao ki kyu kar rhe hai

  • @reyou7
    @reyou7 Před 7 lety +1

    Thanks Harshit Jain for his contributions. Great teacher!

  • @manvikarya725
    @manvikarya725 Před 4 lety

    We subtract one since the current element at ith index is included in both the increasing and decreasing subarray lengths.

  • @dinakarmaurya8000
    @dinakarmaurya8000 Před 6 lety

    Excellent idea...index of i and index j - 1 very interesting...

  • @ayushgangwani1359
    @ayushgangwani1359 Před 3 lety

    7:09 for dec array we are considering non-increasing subarray starting at arr[i] but you have written the reverse of it....btw good explanation

  • @debarghyachowdhury596
    @debarghyachowdhury596 Před 3 lety

    Can't we sort the array and take the last element from each sorted array and do the operation..

  • @prateekmishra6245
    @prateekmishra6245 Před 4 lety +3

    there should be an equality sign

    • @iitkop5080
      @iitkop5080 Před 2 lety

      1st slide dekh hai toh shi...-_-...

  • @prateekmishra6245
    @prateekmishra6245 Před 4 lety

    it does not work when elements are equal (as per definition)

  • @ayushaggarwal4714
    @ayushaggarwal4714 Před 4 lety

    nice video

  • @ayushaggarwal4714
    @ayushaggarwal4714 Před 5 lety

    but why inc+dec -1?

  • @sanandadeysarkar3721
    @sanandadeysarkar3721 Před 5 lety

    Hi
    Will the below code work for this program:
    Int length =0, maxlength=0;boolean flag =false;
    for(int i=0;ia[i]){
    length++;
    }
    else if (a[i+1] 0){
    length++;
    flag =true;
    }
    If(length >maxlength && flag){
    maxlength = length;
    flag = false;
    }
    }
    Please let me know your views. it will help me understand if i am thinking in rihht direction.