Question: /*Help with print function of c++ program can get Double threaded BST to properly allign*/ /*Cannot get program to correctly allign the Double Threaded BST,

/*Help with print function of c++ program can get Double threaded BST to properly allign*/

/*Cannot get program to correctly allign the Double Threaded BST, what is wrong? */

template

void BST::printhelp(BSTNode* root, int level) const

{

BSTNode *tmp = root, *p;

for (;;)

{

cout

p = tmp;

tmp = tmp->rc;

if (!p->rcThread)

{

while (!tmp->lcThread)

{

tmp = tmp->lc;

cout

}

cout

}

if (tmp == root)

break;

cout key()

}

}

/*Currently my output looks like so...*/

/*Help with print function of c++ program can get Double threaded BST

/*I need it to look like this...*/

to properly allign*/ /*Cannot get program to correctly allign the Double Threaded

67 68 69 78 75 79 83 85 87 90 Press any key to continue 67 68 69 78 75 79 83 85 87 90 Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!