Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help with problem #3 of this assignment Submit your hardcopy at the begin

ID: 3694681 • Letter: P

Question

Please help with problem #3 of this assignment

Submit your hardcopy at the beginning on the lecture on 5/2. No submission will be accepted alter the lecture on 5/4. If you cannot attend the lecture on 5/2, you must contact your instructor a hear of time and arrange your submission. Hardcopy submission is required. Please write your answers clearly. How to answer questions. Please be sure to: read the problems and questions**carefully**!!!! check answers - when possible lay out your solutions as neatly as possible In the space provided write down the reasoning used to arrive at the answer - when possible unsupported wrong answers may not receive any credit Each question is followed by space or lines to write your answers Give a stack of objects of type char, write The output and the slack contents at the return of each function call. The slack Is Initially empty. (Assume po p doesn't return anything) Given the queue of objects of type int write the output and the queue contents at the return of each function call. The queue is initially empty (Assume dequeue () doesn't return anything) Given the following tree, answer the following questions. It is a binary tree? why? What are the depth and the height of the node containing 2? write the postorder traversal: Write the postoder traversel Write all internal nodes

Explanation / Answer

Problem #3:

3.a)
Every node cotains two children nodes except node 3. Node 3 contains 4 child nodes.
So, it is not a binary tree.
3.b)
From given tree,
Consider root node depth as 0. Then the depth of the node 2 contains 1.
Consider the height of children node as 1. Then the height of the node 2 contains 3.

3.c)
Postorder traversal is as follows:
4 A B 5 2 6 7 8 9 3 1

3.d)
Preorder traversal is as follows:
1 2 4 5 A B 3 6 7 8 9

3.e)

Leaf nodes are consider internal nodes.
So, the internal nodes are
1 2 3 5