Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!mrlaxs.mrl.uiuc.edu!andreess From: andreess@mrlaxs.mrl.uiuc.edu (Marc Andreessen) Newsgroups: comp.theory Subject: Re: tree traversal Keywords: non-recursive tree traversal algorithm cheater liar fool Message-ID: <1991Feb26.043633.5047@ux1.cso.uiuc.edu> Date: 26 Feb 91 04:36:33 GMT References: <1991Feb25.074028.992@zorch.SF-Bay.ORG> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois, Urbana Lines: 30 In article <1991Feb25.074028.992@zorch.SF-Bay.ORG> xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) writes: > anderson@mrcnext.cso.uiuc.edu writes: > >> I need _non-recursive_ pre, post and inorder tree traversal >> algorithms. >> The trees are implemented with leftmost-child, right-sibling and >> parent pointers. >> Please, no algorithms which use "states" or a stack. This is a blatant attempt by a student in CS225 here at UIUC to farm out his homework to the net. The question given in class (and due 26 Feb) is 3.19 from _Data Structures and Algorithms_ (Aho, Hopcraft, Ullman): "Suppose trees are implemented by leftmost-child, right-sibling, and parent pointers. Give nonrecursive preorder, postorder, and inorder traversal algorithms that do not use 'states' or a stack." If the class's professor happens to be reading this newsgroup, the student in question is cs225cz, aka Brent J. Anderson, who has since posted a question to our internal CS225 notesfile inquiring as to the legality of a variable maintaining current up/down traversal state in an attempt to cash in on Kent's pseudo-algorithm. Marc -- Marc Andreessen___________University of Illinois Materials Research Laboratory Internet: andreessen@uimrl7.mrl.uiuc.edu____________Bitnet: andreessen@uiucmrl Brought to you by Super Global Mega Corp .com