Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/*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...*/

image text in transcribed

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

image text in transcribed

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

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

More Books

Students also viewed these Databases questions