Question: (define-type Tree (leaf [val : Number]) (node [val : Number] [left : Tree] [right : Tree])) I'm trying to make a function that takes this
(define-type Tree (leaf [val : Number]) (node [val : Number] [left : Tree] [right : Tree]))
I'm trying to make a function that takes this tree in racket and have it return the tree with negated numbers. In other words, have it come back with negative numbers. However, my negate function keeps giving me errors that I don't seem to understand. I got halfway into the function and started getting errors and I'm stumped.
I want to see how someone else does it to see what I'm doing wrong. Thanks in advance!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
