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

The goal of this assignment is to reinforce the tree data structure in C++. Spec

ID: 3600077 • Letter: T

Question

The goal of this assignment is to reinforce the tree data structure in C++. Specifically, the assignment is to do the following:
- Construct a function that will display a binary tree by levels (each level on a separate line). If there is no node at a position in a level, then the function should display NULL. Only levels that contain at least 1 datum should be displayed.

--------------------------------------

Bintree.h

--------------------------------------

--------------------------------------

node2.h

--------------------------------------

---------------------------------------

node2.template

---------------------------------------

---------------------------------------

bintree.template

----------------------------------------

Explanation / Answer

steps :

> Put root in queue.
> Put NULL in queue.
> While Queue is not empty
> x = fetch first element from queue
> If x is not NULL
> x->rpeer <= top element of queue.
> put left and right child of x in queue
> else
> if queue is not empty
> put NULL in queue
> end if
> end while
> return

thanks

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote