Frequency of each element in an integer array | Brute force | JAVA interview question

แชร์
ฝัง

ความคิดเห็น • 20

  • @Riteshpc-c3x
    @Riteshpc-c3x 6 วันที่ผ่านมา

    thanks

  • @myviewyt3332
    @myviewyt3332 2 ปีที่แล้ว +1

    Well explained

  • @kalpshah2070
    @kalpshah2070 ปีที่แล้ว

    i have doubt related that you have print elements and their frequency for unique elements that not visited but what about that elements that stored in freq[j] how they print?

  • @AkashYadav-tc2lo
    @AkashYadav-tc2lo 2 ปีที่แล้ว +4

    very well explained. Thanks, but still i have a confusion on why we have stored visited in arr[j] ??

    • @TechnosageLearning
      @TechnosageLearning  2 ปีที่แล้ว +2

      We have set freq[j] = visited....because we have already updated the count of that element(freq[j]) and we dont want to visit that element again
      Otherwise same element's frequency will be updated again and again and it wont provide the required result.

  • @politics2198
    @politics2198 ปีที่แล้ว

    very Awesome explaination.

  • @rajrawat6376
    @rajrawat6376 2 ปีที่แล้ว +2

    How to do it if time complexity O(N) using brute force

    • @TechnosageLearning
      @TechnosageLearning  2 ปีที่แล้ว +1

      th-cam.com/video/pzQvKGcze3A/w-d-xo.html
      Checkout this video

    • @rajrawat6376
      @rajrawat6376 ปีที่แล้ว

      @@TechnosageLearning yeah i hve checked out this but the concept of has map isn't thought to us yet so i was asking if there was any other way

  • @Caped_Crusader7
    @Caped_Crusader7 8 วันที่ผ่านมา

    why visited = -1?

  • @basithnizam
    @basithnizam ปีที่แล้ว +1

    what will happen if the give array has value of visited that is "-1"

    • @yashas1322
      @yashas1322 3 หลายเดือนก่อน

      it will not print(exclude)

  • @supriya_codes
    @supriya_codes ปีที่แล้ว

    which screen recorder u r using??

  • @samdarsh3795
    @samdarsh3795 2 ปีที่แล้ว +2

    Well explained mam 👍

  • @user-bw7ew9lr5l
    @user-bw7ew9lr5l 6 หลายเดือนก่อน

    same as the code in the internet

  • @naushadalam5129
    @naushadalam5129 ปีที่แล้ว +1

    8
    2 0 1 1 1 0 3 1
    ans=2 4 1 1
    code output=2 4 1 0
    how can i handle this case