from queue_code import Queue #Logarithmic Insertion class PriorityQueue(Queue): def enqueue(self, item): if self.is_empty(): self._items.append(item) return #Model the binary search, but for insertion right=len(self._items)-1 left=0 while left<=right: index = (left+right)//2 if self._items[index] > item: left=index+1 else: right=index-1 self._items.insert(left,item)