作者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)
3F:推 aquariusgirl:噢噢噢,真是太感谢你了!!!!! 02/14 22:53