Question: ocaml language please - Define twistTree that twists the data around the tree without changing the branching structure. Here are some example inputs and outputs:

ocaml language please -

Define twistTree that twists the data around the tree without changing the branching structure. Here are some example inputs and outputs: twistTree (Branch (Branch (Leaf 1, 2, Leaf 3), 4, Branch (Leaf 5, 6, Leaf 7))) = (Branch (Branch (Leaf 3, 5, Leaf 2), 1, Branch (Leaf 7, 4, Leaf 6))) twistTree (Branch (Leaf 3, 1, Branch (Leaf 4, 2, Leaf 5))) = (Branch (Leaf 4, 3, Branch (Leaf 5, 1, Leaf 2))) Hint: Draw the input and output trees in graphical form.

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 Databases Questions!