Binary Search Trees
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I have two binary tree structures shown below. The unsortedBTree has values and the sortedBTree is empty. I want to fill the sortedBTree with the values of unsortedBTree sorting them by the values of counter inserting the biggest values to the right. Can anyone please give a short sample code on how to do it without recurtion, but with a while loop? typedef struct UNSORTEDBTREE { int a[3]; int counter; unsortedBTree *left; unsortedBTree *right; unsortedBTree *parent; }unsortedBTree; typedef struct SORTEDBTREE { int a[3]; int counter; sortedBTree *left; sortedBTree *right; sortedBTree *parent; }sortedBTree; Thanks in advance! sirtimid