Re: [Tutor] remove function

2006-07-27 Thread Alan Gauld
def remove(self): maxi = 0 for i in range(1, len(self.items)): if self.items[i] self.items[maxi]: maxi = i item = self.items[maxi] return item My question concerns the remove function. The function returns the maximum value. However, I'm curious about

Re: [Tutor] remove function

2006-07-27 Thread Kent Johnson
Christopher Spears wrote: My apologies to everyone. Here is the complete code: class PriorityQueue: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def insert(self, item):

[Tutor] remove function

2006-07-26 Thread Christopher Spears
Here is a class called PriorityQueue: class PriorityQueue: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def insert(self, item): self.items.append(item)

Re: [Tutor] remove function

2006-07-26 Thread Luke Paireepinart
Christopher Spears wrote: Here is a class called PriorityQueue: class PriorityQueue: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def insert(self, item):

Re: [Tutor] remove function

2006-07-26 Thread Christopher Spears
My apologies to everyone. Here is the complete code: class PriorityQueue: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def insert(self, item):