Theoretically speaking if one wanted to swap the sub trees of a binary tree wouldnt it be as simple as telling the roots left pointer to point to the right pointer and the right pointer to point to the left pointer??
Or is there more to it?
Theoretically should this algorithm work?C++ Algorithm?
You'll want a temp var in there of course.
tempPtr = rightPtr
rightPrt = leftPtr
leftPtr = tempPtr
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment