Ocaml 中序遍历

let in_order tree  =
  let rec aux tree accumulator =
    match tree with
    | Nil -> accumulator
    |Member (left, value, right) -> 
      let acc_with_right = aux right accumulator  in
      let acc_with_value =  value :: acc_with_right  in
      aux left acc_with_value in
  aux tree [] 
给大家分享一下一个Ocaml 写 中序遍历的写法,中序遍历是左中右。
全部评论

相关推荐

06-26 17:24
已编辑
宁波大学 Java
迷失西雅图:别给,纯kpi,别问我为什么知道
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务