1. Please design a linear-time algorithm that clones a binary tree T. This algorithm should construct an exact copy of T. You are only allowed to use the methods of the Tree and Binary Tree ADTs (i.e., isEmpty, root, parent, children, isInternal, isExternal, isRoot, size, elements, positions, swapElements, replaceElement, leftChild, rightChild, sibling, expandExternal, removeAboveExternal).
a. Describe (in pseudo-code) your algorithm.
b. Analyze its worst-case running time.
Hi there! Click one of our representatives below and we will get back to you as soon as possible.