Re: [理工] 104 台大資工 線代 OS DS 對答案

看板Grad-ProbAsk作者時間9年前 (2017/01/26 14:16), 9年前編輯推噓4(401)
留言5則, 3人參與, 最新討論串4/5 (看更多)
※ 引述《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

01/26 14:27, , 1F
他應該是假設level從1開始所以會是2^k -1如果level從0
01/26 14:27, 1F

01/26 14:27, , 2F
開始答案會是你想的那樣
01/26 14:27, 2F
但此題題目為"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

01/30 17:23, , 3F
第4小題也會變成log(n+1) -1
01/30 17:23, 3F

01/30 17:24, , 4F
我覺得原po按照網站寫是對的
01/30 17:24, 4F

02/05 22:37, , 5F
這應該是正解+1
02/05 22:37, 5F
文章代碼(AID): #1OYPGX1k (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1OYPGX1k (Grad-ProbAsk)