A作者ssssIssss (O_O)
看板Grad-ProbAsk
標題Re: [理工] 104 台大資工 線代 OS DS 對答案
時間Thu Jan 26 14:15:57 2017
※ 引述《yaxauw (yaxauw)》之銘言:
: 想跟大家對一下線代還有DS的答案
: 【DS】
: 是103年改簡述題改到怕了嗎.. 難度差異好大
: 一.
: 1~6 ABBABA
: 7~10 BBBA
: 二. 四.
: http://imgur.com/N9NLbpb
依照由網站
http://typeocaml.com/2014/11/26/height-depth-and-level-of-a-tree/
所述,那第二大題第二小題答案應為2^(k+1)-1嗎?
整理一下此網站所述
height:root至leaf所經的longest path長
level:1 + (root到指定node間的edge數)
depth:root到指定node間的edge數
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.27.185.222
※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1485411361.A.06E.html
推 weilun911: 他應該是假設level從1開始所以會是2^k -1如果level從0 01/26 14:27
→ weilun911: 開始答案會是你想的那樣 01/26 14:27
但此題題目為"What is the maximum number of nodes in a binary tree of depth k?"
此處是從depth出發而不是level..?
※ 編輯: ssssIssss (140.112.94.109), 01/29/2017 11:24:43
推 h42318: 第4小題也會變成log(n+1) -1 01/30 17:23
推 h42318: 我覺得原po按照網站寫是對的 01/30 17:24
推 vcyc: 這應該是正解+1 02/05 22:37