{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

2c03-review - 00003 - 5[13 a[10 type Tree = record labels...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
3 5.[13] a.[10] type Tree = record labels: array[1..max] of labeltype; n: 1..max; end; procedure Preorder(T: Tree) begin PrintPre(T, 1) end procedure PrintPre(T:Tree, m:1..max) begin if m>T.n then return; write(T.lables[m]); PrintPre(T, 2*m); PrintPre(T, 2*m+1) end b.[3] O(n). Since every node is visited only one time.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}