COMS W3134 Lecture Notes - Lecture 8: Binary Expression Tree, Tree Traversal, Binary Tree

29 views2 pages

Document Summary

Evalute let child right child apply operator. I expression tree : binary tree used for math expressions int operant i char operator i. Node right i private static class node g class expression tree i. A call on expression tree public interval 111. A private era ill takes root return eval ( root ti. Node root i check it left i right = hull. Possible exam question pre - fix expressions (cid:15482) pre - order transversal. A b dec root left right. C post - order : debca left right root. E in order : dbeac left root right given post and pre reconstruct tree given post and in order root is always the last node in post , in order find that node in. 5 postfix (cid:15482) 572 - t prefix (cid:15482) +5 - 72 infix (cid:15482) 5-17-2 ( post order ) ( pre order )

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents