For indentations I've developed the habit of pressing four spaces. Thank you python! With trees and their preorder, postorder, and inorder everything seems to revolve around recursion. While I learned how to make these trees from simple input, I never really learned how to make trees from the preorder and postorder. Quite an interesting task, it required much more thinking and pen and paper than typing. Ever since my first difficult computer science assignment (the tour of Anne Hoy) I've been thinking things out first on paper as it really does help. It has shown me that in the end, everything boils down to recursion when it comes to trees. Recursion is great, when you understand it.
No comments:
Post a Comment