Question: uPart one is a recursive function tree - insert that takes a tree and a number and returns the tree with the number inserted. u

uPart one is a recursive function tree-insert that takes a tree and a number and returns the tree with the number inserted.
u
u(tree-insert 8()) should return (8)
u(tree-insert 12'(8)) should return '(8((12)))
u(tree-insert 3'(8)) should return '(8((3)()))
u(tree-insert 12'(8((3)()))) should return '(8((3)(12)))
u(tree-insert 4'(8((3)(12)))) should return '(8((3((4)))(12)))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!