Queue in Python 🐍 | Data Structure in Python with execution 👩‍💻

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ธ.ค. 2024

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

  • @LYRICWAVEFORM
    @LYRICWAVEFORM 11 หลายเดือนก่อน +1

    sir your videos are very important for me your teaching style is awesome

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

    You are always explain well ❤❤❤❤❤❤❤🎉🎉🎉🎉🎉

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

    Clear logic delivered, thanks.

  • @Syed_Lord
    @Syed_Lord 5 หลายเดือนก่อน

    I made some changes in your code and it is working fine and is more easy to understand:
    class Queue:
    def __init__(self):
    self.values = []

    def enqueue(self, x):
    self.values.append(x)
    def dequeue(self):
    self.values.pop(0)
    def peek(self):
    print(self.values[0])

    • @ISHQCHRONICLES
      @ISHQCHRONICLES 4 หลายเดือนก่อน

      class Queue:
      def __init__(self):
      self.values = []
      def enqueue(self, x):
      self.values.append(x)
      def dequeue(self):
      if not self.is_empty():
      return self.values.pop(0) # Remove and return the first element
      else:
      raise IndexError("dequeue from empty queue")
      def is_empty(self):
      return len(self.values) == 0
      If list is already empty then how will you pop, to handle that.

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

    Thanks ❤❤❤❤

  • @bhishamlalmandle5390
    @bhishamlalmandle5390 7 หลายเดือนก่อน

    Nice video thank you sir

  • @JOGENDRA_JAKHAR.
    @JOGENDRA_JAKHAR. ปีที่แล้ว +3

    Sir aapkiski teyari krvate ho.... Tell me plz...

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

    Sir I am so so so impressed by your learning methods i haven't word for explain my feelings.

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

    Sir graph,tree, hashing ka bhi video bano sir ji❤❤❤❤

  • @SanaAli-ln3xy
    @SanaAli-ln3xy 10 หลายเดือนก่อน

    Sir implementation of queue using array and link list ka lecture explain kr day plzzz🙏

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

    sir linear algebra ka playlist ni h ??

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

    sir pgt computer science k notes mil skte h apke bnye hue ......ap boht achha pdate ho mujhe or kisi ka pdaya huaa smjh nhi aata sirf apki class smjh aati h

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

    Hi sir
    I am rama from Ramareddymathsacademy
    How can I contact you

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

      Hello! You can mail us at gatesmashers2018@gmail.com

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

    why can't we use pop(0) as we have used in the stack why front variable and slicing small dout..

  • @chesswithsarang
    @chesswithsarang 5 หลายเดือนก่อน

    Sir this is good but, you should mention that dequeue in your implementation is O(n) time complexity.

  • @FarazKhan-xl4qr
    @FarazKhan-xl4qr 9 หลายเดือนก่อน

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

    [1:]