What is a HashSet? | Data Structures | Easy explanation with animations | Study Algorithms

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

Комментарии • 18

  • @ukaszkiepas57
    @ukaszkiepas57 7 месяцев назад

    Thank you bro. Clean explenation :)
    Helped me a lot!

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

    This is Gold!

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

    O(1) for deleting an element in an array is debatable, if you want to move the above elements down to fill the gap it gets slower.

  • @ET-Programming
    @ET-Programming Год назад +1

    deleting an element from an Array is o(1) only for if the element is the last element on the array ,so if i want to remove an element from middle it is o(n) ,

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

      in an array, you can go straight to an index. That means O(1)

  • @amruthaj4262
    @amruthaj4262 7 месяцев назад

    I just wanna know, is the time complexity O(1) for a Linked List at the head and tail?

    • @nikoo28
      @nikoo28  5 месяцев назад

      to add an element at the tail of the linked list, the time complexity is O(n).
      to add at the head, the time complexity is O(1)

    • @amruthaj4262
      @amruthaj4262 5 месяцев назад

      @@nikoo28Thank you

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

    ok but , how it uses hashing to do all this operations in O(1) time complexity? thats what i wanted to know :(

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

      Those are the internal details on how a hashset actually works. I will create a separate video on hashing sometime in the future.

  • @ap-learner
    @ap-learner Месяц назад

    You said it O(1) for reading but not explained why it is, Please explain

    • @nikoo28
      @nikoo28  Месяц назад +1

      you will have to understand the internals of a HashSet data structure. I plan to make a video on it in my System Design series

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

    Sir , where can I contact you?
    I need some help.

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

      Check the channel description, you will find an email address to reach out.
      You can also comment here

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

      I cannot sir.
      Can we talk on LinkedIn or Discord/Twitter?

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

      Send me an email

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

    How it different from dictionary

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

      It is almost the same as a dictionary…the major difference is that a hashset is synchronised (works good in a multi threading code)
      The use of Dictionary is now kind of obsolete and deprecated. You are not advised to use a Dictionary