Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION : 1. a hand drawn picture, in pdf or png format, of the general tree t1 generated by the code in the TD driver.

image text in transcribed

QUESTION :

1. a hand drawn picture, in pdf or png format, of the general tree t1 generated by the code in the TD driver.

2. the breadth first traversal ( by levels ).

NOTE: this code is in C++

TDTree tl( preceed); //create tree t1.add( 'H', 'H', 1); t1.add( 'H', '1', 1); t1.add( 'i','', 1); t1.add( 'H', 't', 2); t1.add( 't', 'h', 1); t1.add( 't', 'y', 2); t1.add( 't', 'e', 3); // t1.add( 'H', 'Z', 3); // t1.add( 'i', 'y', 2); t1.add( 'h', 'E', 1); Now look at the implementation of our add: bool add (Base Data parent, BaseData item, int childnum); we see we must specify: the parent (node) the item (the child node of the parent) the childnum ( is the child a 15 child, 2nd child, 3rd child,...) so starting from an empty tree we must add the root node t1.add( 'H', 'H', 1); (yes, that's the only way to add the root) t1.add( 'H', 'i', 1); (i is the first child of H) t1.add('i,'', 1); (a blank space id the first child of i) t1.add( 'H', 't', 2); (t is the second child of H) and so on. 1. a hand drawn picture, in pdf or png format, of the general tree t1 generated by the code in the TD driver. 2. the breadth first traversal (by levels)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

Need help with this question in python

Answered: 1 week ago