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 (4 + 5 + 4 + 6 + 5 = 24 points)
 

Summary: First name Last name Matriculation number
1
Exercise 1 (4 + 5 + 4 + 6 + 5 = 24 points)
The following data structure represents polymorphic binary trees that contain values only in
special Value nodes that have a single successor:
data Tree a = Leaf | Node (Tree a) (Tree a) | Value a (Tree a)
Consider the tree t of characters on the right-hand side.
The representation of t as an object of type Tree Char
in Haskell would be:
(Node (Value 'a' (Value 'b' Leaf)) (Node (Node
Leaf Leaf) (Value 'c' Leaf)))

aaaaaaaa
ooooooooooooo
'a' ∑
ffffffff
““““““““
'b' ∑
————————
aaaaaaaa 'c'

  

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

 

Collections: Computer Technologies and Information Sciences