All O`one Data Structure

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

КОМЕНТАРІ • 10

  • @GANESHKUMAR-ww9dv
    @GANESHKUMAR-ww9dv 2 місяці тому

    Wowwwww. Thought it will take atleast 3-4 vidoes to understand this problem. Glad I watched your video first. Great and clearrrr explanation. Thanks dude.

  • @SHUBHAMJHA-o3g
    @SHUBHAMJHA-o3g 2 місяці тому

    A well thought explanation.
    I am impressed.❤

    • @techdose4u
      @techdose4u  2 місяці тому

      Thanks :)

    • @SHUBHAMJHA-o3g
      @SHUBHAMJHA-o3g 2 місяці тому

      @@techdose4u yes and I was always watching just enough so that I get the key concept that was required...
      and I tell you the moment you told min is going to be next of head and max is going to be prev of tail....
      damn I got the whole code and that too clean!

  • @FunToDetox
    @FunToDetox 2 місяці тому

    Can’t we only hashmap only to implement this? Why we need linked list or array here ? As we can store frequencies of those keys in the map instead of object

    • @techdose4u
      @techdose4u  2 місяці тому

      every map value part should be pointing to next entry.
      If you try with the example which I have taken in dry run you will get it clear :)

  • @akhil1996YT
    @akhil1996YT 2 місяці тому

    Didn't understand how adding a new string is O(1) time. Doesn't it take O(n) time in DLL to add a new element so that DLL is sorted.

    • @techdose4u
      @techdose4u  2 місяці тому

      Because we know the location of node from hashmap where to insert.
      Please follow the entire video, I have shown this in dry run too and also in code.

    • @ashwint959
      @ashwint959 2 місяці тому +1

      A new string will always be added to the beginning only

    • @akhil1996YT
      @akhil1996YT 2 місяці тому

      Makes sense now