Well, here we are again, me writing and you reading about computer science. Well, now that assignment one is complete, we can now begin on trees. Trees are a completely new data structure to me, at least to program so it can provide some trouble. It's extremely difficult to visualize how trees are structured as there's no way to essentially print what a tree looks like inn python without writing your own custom str method.
The reason I presume for us to learn about trees is the way we navigate through them. And of course, as you guessed it, it's recursively. The reason we do this is because all trees start with a root node. Each root node and possibly children. But some of the children might have it's own children. We can essentially view each original child and all their children as it's own tree, therefore looking a layer deeper into the tree. When a node has no children, that node is referred to as a leaf and still can be viewed as a tree itself, just with no children.
In my continual learning of computer science and programming, I've realized if I ever need help with concepts, while I can google or ask a TA, I've only just realized that there's hundreds of other SLOGS out there for me to read. I've become fond of http://slogslogslogslog.blogspot.ca/ It seems that student, "Penguins Go Noot" and I share some of the same problems, but he/she has found solutions that have helped me out.
The hardest part of this week has just been trying to picture and visualize a tree structure, but I'm sure with a lot of practice and constant work, I'll get the hang of it.
No comments:
Post a Comment