Search⌘ K
AI Features

Challenge: Copy Tree

Explore how to copy the values of a binary tree to a new tree in Go. This lesson guides you through creating a copyTree function, testing it, and verifying the output matches the original, strengthening your understanding of tree manipulation in Go.

Problem

Given a binary tree, copy its values to another binary tree.

Input

A binary tree.

Output

A new binary tree with the data of the given ...