Question: I have a program to insert the elements of my binary tree to a sorted list ( Which was implemented earlier by the book) So

I have a program to insert the elements of my binary tree to a sorted list ( Which was implemented earlier by the book)

So I worte this function Not that SAList : is sorted array list which inserts elements in sorted positions.

Thats the code I wrote but im getting an error : Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

Any help ?

template void BinTreeToSAList ( SAList L1 , BinNode* subroot) { if (subroot==NULL) return; else {

BinTreeToSAList(L1,subroot->left());

BinTreeToSAList(L1,subroot->right());

L1.insert(subroot->val()); }

}

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!