data_structures/queues/priority_queues_custom.py
def put(self, element):
        """ Insert an element at the right place """
        i=0
        while i < self.length:
            e = self.data[i]
            if element < e:
                self.data = self.data[:i] + [element] + self.data[i:]
                i = self.length
            i+=1
        if i == self.length:
            self.data.append(element)
        
        self.length+=1
 Insert an element at the right place 
Insert an element at the right place
Insert an element at the right place
def put(self, element):
        i=0
        while i < self.length:
            e = self.data[i]
            if element < e:
                self.data = self.data[:i] + [element] + self.data[i:]
                i = self.length
            i+=1
        if i == self.length:
            self.data.append(element)
        self.length+=1
def put ( self , element ) : i = 0 while i < self . length : e = self . data [ i ] if element < e : self . data = self . data [ : i ] + [ element ] + self . data [ i : ] i = self . length i += 1 if i == self . length : self . data . append ( element ) self . length += 1
Insert an element at the right place
Insert an element at the right place
""" Insert an element at the right place """
self
element