Advertisement
Guest User

Untitled

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