Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
First name Last name Matriculation number Exercise 1 (2+2+2 points)
 

Summary: First name Last name Matriculation number
1
Exercise 1 (2+2+2 points)
The following data structure represents binary trees only containing values in the inner nodes:
data Tree a = Leaf | Node (Tree a) a (Tree a)
Consider the tree t of integers on the right-hand
side. The representation of t as an object of type
Tree Int in Haskell would be:
Node (Node Leaf 2 Leaf) 1 Leaf
1
````````
———————
2
bbbbbbbb
———————

∑ ∑
Implement the following functions in Haskell.
(a) Please implement the function swapTree which returns the tree where all left children
have been swapped with the corresponding right

  

Source: ŃbrahŠm, Erika - Fachgruppe Informatik, Rheinisch Westfšlische Technische Hochschule Aachen (RWTH)

 

Collections: Computer Technologies and Information Sciences