Advertisement
Guest User

Untitled

a guest
Nov 28th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.30 KB | None | 0 0
  1. let rec tryFindPathtoAux v t acc =
  2.     match t with
  3.     | [] -> []:Path
  4.     | t::ts -> tryFindPathto v t acc+1::acc @ tryFindPathtoAux v ts acc:: :Path
  5. and tryFindPathto v t =
  6.     match t with
  7.     | N(n,_) when n = v -> []:Path
  8.     | N(_,ts) -> List.findIndex (isEqual v) ts::(tryFindPathtoAux v ts);;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement