+1 (218) 451-4151
glass
pen
clip
papers
heaphones

Our definition of the level numbering function f(p), as given in Section 8.3.2, begins with the…

Our definition of the level numbering function f(p), as given in Section 8.3.2, begins with the…

Our definition of the level numbering function f(p), as given in Section 8.3.2, begins with the root having number 0. Some people prefer to use a level numbering g(p) in which the root is assigned number 1, because it simplifies the arithmetic for finding neighboring positions. Redo Exercise R-8.16, but assuming that we use a level numbering g(p) in which the root is assigned number 1.Exercise R-8.16Let T be a binary tree with n positions that is realized with an array representation A, and let f() be the level numbering function of the positions of T, as given in Section 8.3.2. Give pseudocode descriptions of each of the methodsroot, parent, left, right, isExternal, and isRoot.