62. 中序遍历

中等0

实现二叉树中序遍历的类型版本。

例如:

const tree1 = {
  val: 1,
  left: null,
  right: {
    val: 2,
    left: {
      val: 3,
      left: null,
      right: null,
    },
    right: null,
  },
} as const

type A = InorderTraversal<typeof tree1> // expected to be  [1, 3, 2]
评论(0)
题库

TypeScript

加载中...