小编Edd*_*Edd的帖子

如何在Haskell中构建图形?

如何在Haskell中构建一个图形:

type Node = Int
type Arc = (Node, Node) 
Run Code Online (Sandbox Code Playgroud)

和功能:

class Graph g where
         build :: [Node] -> [Arc] -> g
Run Code Online (Sandbox Code Playgroud)

haskell graph

1
推荐指数
1
解决办法
286
查看次数

Haskell中二进制搜索树中的元素?

如何在Haskell中搜索二叉搜索树中的元素?我定义了我的树:

 data Tree a = 
     Null | 
     L a | 
     N (Tree a) a (Tree a) 
     deriving Show 
Run Code Online (Sandbox Code Playgroud)

我想创建一个在BST中搜索元素的函数:

 findElem :: Tree a -> a -> Maybe a
 findElem tree n = ...
Run Code Online (Sandbox Code Playgroud)

我该怎么做?

search haskell binary-search-tree

-1
推荐指数
1
解决办法
359
查看次数

标签 统计

haskell ×2

binary-search-tree ×1

graph ×1

search ×1