Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
pp:2026:scala:l05 [2026/03/27 17:15] cosmin.asavoae 5.3.2: renamed subtree to size; 5.3.4: clarified what counts as a successful append |
pp:2026:scala:l05 [2026/05/02 21:34] (current) cosmin.asavoae |
||
|---|---|---|---|
| Line 131: | Line 131: | ||
| </code> | </code> | ||
| - | **(!) 5.3.5** Write a function which takes two BinaryTree and tries to assign the second tree as a child of the first. It should return a "container" of a BinaryTree. The append is successfull if the second tree can become a direct child of the first tree's root. | + | **(!) 5.3.5** Write a function which takes two BinaryTree and tries to assign the second tree as a child of the first. It should return a "container" of a BinaryTree. The append is successful if the second tree can become a direct child of the first tree's root. |
| <code scala> | <code scala> | ||
| def append(tree1: BinaryTree, tree2: BinaryTree): Option[BinaryTree] = ??? | def append(tree1: BinaryTree, tree2: BinaryTree): Option[BinaryTree] = ??? | ||