[問題] 自己呼叫自己? 麻煩給個指點
看板C_and_CPP (C/C++)作者kaoh08 (AIR -the 1000th summer-)時間12年前 (2013/11/07 00:52)推噓1(1推 0噓 3→)留言4則, 4人參與討論串1/2 (看更多)
問題(Question):程式看不懂,請告訴我這是什麼,我就能翻書找。
預期的正確結果(Expected Output):二元樹程式
程式碼(Code):(請善用置底文網頁, 記得排版)
例如這個binTree.h 第321行,private版的inorder,
template <class T>
void binTree<T>::inorder(binTreeNode<T>* child, void (* ptr)(T&))
{
if(child != NULL)
{
inorder(child->left, ptr); //自己呼叫自己?
ptr(child->data); //到底執行了什麼?
inorder(child->right, ptr);
}
}
prog6.cc http://pastebin.com/9aaxggWC 主程式
prog6.h http://pastebin.com/t0ZXTvBx
binTree.h http://pastebin.com/QCYqJYi4 二元樹的implementation
binTreeNode.h http://pastebin.com/9wVGDWAC 二元樹node的class
補充說明(Supplement):
--
歡迎加入Folding@home分散式運算台灣國家隊 幫助研究解決蛋白質誤疊疾病
Stanford Folding@home 首頁
http://folding.stanford.edu/English/HomePage
Taiwan Team(31403) 主頁
http://fah-web.stanford.edu/cgi-bin/main.py?qtype=teampage&teamnum=31403
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 18.248.2.85
→
11/07 01:04, , 1F
11/07 01:04, 1F
推
11/07 01:42, , 2F
11/07 01:42, 2F
→
11/07 02:18, , 3F
11/07 02:18, 3F
→
11/07 11:03, , 4F
11/07 11:03, 4F
※ 編輯: kaoh08 (18.248.2.85), 12/06/2017 07:27:06
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章