Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.34 KB

File metadata and controls

26 lines (20 loc) · 1.34 KB

InorderTraversal medium #object

by jiangshan @jiangshanmeta

Take the Challenge

Implement the type version of binary tree inorder traversal.

For example:

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> // [1, 3, 2]

Back Share your Solutions Check out Solutions