作者avogau ( 假 裝)
看板TransCSI
標題Re: [問題] 幾題計概的問題
時間Fri Feb 13 16:21:15 2009
※ 引述《aquariusgirl (學,然後知不足)》之銘言:
: 2.Which of the folloeing is a loop invariant at the point at which
#########
following
: the test for termination is performed in the following loop structure?
問那一個是loop的終止條件
: x←3;
: while(X<5) do
: (X←X+2)
: 答案是X<5,為什麼呀?題目是什麼意思?
: 3.輸入順序依次是3,5,1,8,6,2,11,4,10,9,7的數字,要建AVL tree,
: 我怎麼建都跟答案不一樣~~@@"
: 3 5
: / \ / \
: 1 5 3 8
: \ 接下來變成 / /
: 8 1 6
: / \
: 6 2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
這邊的演變是有問題的
嗯 bbs有點難畫圖
所以我畫在紙上再照相
http://picasaweb.google.com/lh/photo/f3-71NrEWO-6TfQByuM8eA?feat=directlink
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.45.62.147
※ 編輯: avogau 來自: 114.45.62.147 (02/13 16:22)
※ 編輯: avogau 來自: 114.45.62.147 (02/13 16:27)
推 aquariusgirl:噢噢噢,真是太感謝你了!!!!! 02/14 22:53