Maximum Length Bitonic Subarray | GeeksforGeeks

Поділитися
Вставка
  • Опубліковано 19 лис 2024

КОМЕНТАРІ • 16

  • @reyou7
    @reyou7 7 років тому +1

    Thanks Harshit Jain for his contributions. Great teacher!

  • @tusharsaxena8239
    @tusharsaxena8239 3 роки тому +5

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

  • @ayushgangwani1359
    @ayushgangwani1359 3 роки тому

    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

  • @manvikarya725
    @manvikarya725 4 роки тому

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

  • @dinakarmaurya8000
    @dinakarmaurya8000 6 років тому

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

  • @prateekmishra6245
    @prateekmishra6245 4 роки тому +3

    there should be an equality sign

    • @iitkop5080
      @iitkop5080 3 роки тому

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

  • @debarghyachowdhury596
    @debarghyachowdhury596 3 роки тому

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

  • @ayushaggarwal4714
    @ayushaggarwal4714 4 роки тому

    nice video

  • @prateekmishra6245
    @prateekmishra6245 4 роки тому

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

  • @ayushaggarwal4714
    @ayushaggarwal4714 5 років тому

    but why inc+dec -1?

  • @sanandadeysarkar3721
    @sanandadeysarkar3721 5 років тому

    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.