Scheme changing tree values
I need to implement a procedure called inverse-tree that receives a tree whose nodes data values are numbers and booleans and returns the equivalent tree whose nodes satisfy the following: If the equivalent node of the original tree is a number, then the resulting tree’s node is −1· that node value If the equivalent node of the original tree is a boolean, then the resulting tree’s node is the logical not of that node value Examples: > (inverse-tree ’()) ’() > (inverse-tree ’(5)) ’(-5) > (inverse-tree ’(0)) ’(0) > (inverse-tree ’(#f)) ’(#t) > (inverse-tree ’(#t)) ’(#f) > (inverse-tree ’(-5 (1 (