This week we learned about list nodes. These are lists of
nodes within each other that can represent trees. In our examples we used each
node and leaf merely carried a number but I can see it’s uses if it were to
carry other types of information. We also learned to use the __repr__ method,
in which simply inputting an object would return it’s ‘cargo’, as opposed to
inputting ‘print(object)’ or ‘object.__str__()’. It seems to be quite useful
and convenient.
Most other bloggers seem to understand this concept well.
Most other bloggers seem to understand this concept well.
You state that you can see list nodes' uses if it were to carry other types of information. What might some of these uses be?
ReplyDeleteAlso, definitely tried to snag 'csc148slogblog' as a domain name. Beat me to the punch.
Well I was thinking that these lists would be a good way to sort information, just like the search tree example he gave us where smaller numbers go on the left subtree and greater numbers go on the right.
ReplyDeleteAnd lol csc148slogblog is probably the most unimaginative name now that I think about it