wish_me's blog

By wish_me, history, 7 years ago, In English

Given a binary tree return a matrix where mat(i,j) is 1 when i is an ancestor of j. only one traversal required and no extra space required,

  • Vote: I like it
  • -13
  • Vote: I do not like it