您現在的位置是:首頁 > 標簽 > findB首頁標簽

  • 二叉樹兩個節點的最近公共祖先問題

    接下來看遞迴函式的主要邏輯首先是 base case,如果 head 為 null,則 findA = false,findB = false,a 和 b 的公共祖先也是 null即if (head == null) { ...