Queue and Circular Queue Data Structure in Python for Beginners

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

КОМЕНТАРІ • 17

  • @AkashdeepDam
    @AkashdeepDam 3 роки тому +3

    Very nice way to explanation, and it is super easy to understand after watching this video. Thank you for this content 😊

  • @universal4334
    @universal4334 4 роки тому +1

    Superb !! ....there are very few video which were implemented in python . Good move 😉. Looking forward for more 😍

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

    Thank you bro, you resolved my 2 days of confusion :-)

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

    thank you so much for this vid, I was so ready to pull half of my hair out, this made it super clear!!

  • @AftabAhmad-bo1ey
    @AftabAhmad-bo1ey Рік тому

    Best explanation

  • @minimalinput6456
    @minimalinput6456 2 роки тому

    amazing explanation thank you

  • @shubhamkoshti260
    @shubhamkoshti260 4 роки тому +1

    Good job

  • @raajushawarma9367
    @raajushawarma9367 3 роки тому +2

    in dequeue method of circular queue, you didn't use any pop function, how did u remove the elements?

    • @DentrixG
      @DentrixG 2 роки тому

      I was thinking the same. He is technically not removing the element. However, the next time you enqueue, it will just overwrite the values because the tail is still referenced correctly. I guess that works, however if you print the queue that old value that was dequeued will still be there unless it's overwritten with a new value via the enqueue call.

    • @DentrixG
      @DentrixG 2 роки тому +3

      If you want to physically remove the element, you can just set it to None. So after "data = self.storage[self.head]" just add "self.storage[self.head] = None"

  • @kadiryaren5564
    @kadiryaren5564 2 роки тому

    thank you my lovely friend!!!!

  • @jerryrockson7023
    @jerryrockson7023 9 місяців тому

    brilliant

  • @bennguyen1313
    @bennguyen1313 2 роки тому

    So this is a custom implementation of queue? if so, when would you use (or not) the official queue from python?

  • @jiakai7254
    @jiakai7254 Рік тому

    hi if ur size is lower than ur capacity, how do u enqueue into an index that is out of range?
    ie.
    self.storage[self.tail] = data
    would return an error since self.tail exceeds the index range of the queue
    would u perhaps need to use append instead? but that would bring in O(n) space

    • @Seducked37
      @Seducked37 Рік тому

      You can't append in a array based queue as the size is fixed

  • @nahomdiro7818
    @nahomdiro7818 2 роки тому +1

    attach the code for ur super help full videos

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

    perfect!