2c03-review - 00008

2c03-review - 00008 - 4.[15] a.[5] For instance a b c d e...

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

View Full Document Right Arrow Icon
2 4.[15] a.[5] For instance abcd e last b.[10] The simplest is the recursive procedure: global var T : record nodes : array[1. .max] of nodes; last : 0. .max end; procedure INORDER(i : 1. .max); begin if 2×i T.last then INORDER(2×i); print (T.nodes[i]); if 2×i + 1 T.last then INORDER(2×i + 1) end T(n) = O(n) where n is the size of tree, every node is visited once and only once! 5.[10] The simple algorithm described below is easier to discover than to explain in few sentences. Explanation is not required as a part of a solution. Since this is a complete tree than we have
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.

Ask a homework question - tutors are online