a function, swapSubtrees

  1. Write a function, swapSubtrees, that swaps all of the left and right subtrees of a binary tree. Add this function to the class binaryTreeType and create a program to test this function.
  2. Write a function, singleParent, that returns the number of nodes in a binary tree that have only one child. Add this function to the class binaryTreeType and create a program to test this function. (Note: first, create a binary search tree.)

Leave a Reply

Your email address will not be published. Required fields are marked *