After reading John's reply, I think I get it now: >>> from linked_queue import * >>> queue = Queue() >>> queue.isEmpty() True >>> queue.insert("cargo") >>> queue.length 1 >>> queue.insert("more cargo") >>> queue.length 2 >>> print queue.head cargo >>> print queue.head.next more cargo >>> queue.insert("more and better cargo") >>> print queue.head.next more cargo >>> print queue.head.next.next more and better cargo >>> queue.insert("snakes") >>> print queue.head cargo >>> last = queue.head >>> last.next <linked_queue.Node instance at 0xb7d5fdcc> >>> print last.next more cargo >>> print last.next.next more and better cargo >>> print last.next.next.next snakes
One of my problems in conecptualizing this is that I thought a linked queue was just a linked list. Is a linked queue a linked list? There seems to be a subtle difference... _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor