Computers and Technology

Using the type notation, write two oz functions for determining the sum of the elements of:

a) nested list, given by:

& λτ; nlist t& γτ; : : =

nil |

& λτ; nlist t> '|' & λτ; nlist t> |

t '|' & λτ; nlist t& γτ; (t is not nil nor a cons)

b) binary tree, given by:

leaf |

tree(value: t

left:
right: )

for example, the call {sumnestedlist [[1 2] [3 5] [3 [1]]]} will display 15, and the call

{sumbinarytree tree(value: 2

left: tree(value: 3

left: tree(value: 5

left: leaf

right: leaf)

right: leaf)

right: tree(value: 4

left: leaf

right: leaf)

)}

will display 14.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:30, juliannxkim
Which group on the home tab allows you to add shapes to a powerpoint slide?
Answers: 1
image
Computers and Technology, 22.06.2019 09:30, eiza666
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
image
Computers and Technology, 22.06.2019 22:00, robert7248
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
image
Computers and Technology, 24.06.2019 00:00, Amrinderkhattra
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
Do you know the correct answer?
Using the type notation, write two oz functions for determining the sum of the elements of:

Questions in other subjects:

Konu
Mathematics, 30.04.2021 02:40
Konu
Mathematics, 30.04.2021 02:40