Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Module ----------------------------------------------------------------------
- module Aufgabe7 where
- -- Import ----------------------------------------------------------------------
- import Data.List
- import Data.Maybe
- -- Deklarationen ---------------------------------------------------------------
- type Vertex = Integer
- type Origin = Vertex
- type Destination = Vertex
- type Key = Integer
- type Name = Integer
- data BTree a = BLeaf Key a | BNode Key a (BTree a) (BTree a) deriving Show
- data LTree a = LNode Key a [(LTree a)] deriving Show
- data ALgraph = ALg [(Origin,[Destination])] deriving (Eq,Show)
- class Structure s where
- noOfSources :: s -> Integer
- noOfSources (BNode k s l r) = 1
- noOfSources _ = 1
- noOfSources s = 1
- -- noOfSinks :: s -> Integer
- -- notSourceConnected :: s -> [Name]
- -- notSinkConnected :: s -> [Name]
- -- instance Eq a => Eq (LTree a) where
- instance Eq a => Eq (BTree a) where
- (==) a (BNode k v l r) = True
- (==) _ _ = False
Add Comment
Please, Sign In to add comment