figure parse tree for simple sentence the assertion that we can build the heap in (nmay seem bit mysterious at firstand proof is beyond the scope of this book howeverthe key to understanding that you can build the heap in (nis to remember that the log factor is derived from the height of the tree for most of the work in build_heapthe tree is shorter than log using the fact that you can build heap from list in (ntimeyou will construct sorting algorithm that uses heap and sorts list in ( log nas an exercise at the end of this binary tree applications with the implementation of our tree data structure completewe now look at an example of how tree can be used to solve some real problems in this section we will look at parse trees parse trees can be used to represent real-world constructions like sentences or mathematical expressions figure shows the hierarchical structure of simple sentence representing sentence as tree structure allows us to work with the individual parts of the sentence by using subtrees we can also represent mathematical expression such as (( ( )as parse treeas shown in figure we have already looked at fully parenthesized expressionsso what do we know about this expressionwe know that multiplication has higher precedence than either addition or subtraction because of the parentheseswe know that before we can do the multiplication we must evaluate the parenthesized addition and subtraction expressions the hierarchy of the tree helps us understand the order of evaluation for the whole expression before we can evaluate the top-level multiplicationwe must evaluate the addition and the subtraction in the subtrees the additionwhich is the left subtreeevaluates to the subtractionwhich is the right subtreeevaluates to using the hierarchical structure of treeswe can simply trees and tree algorithms