代码大全

(singke) #1
Found=True
else
i++;

if Found
......
found i<ElementCount Found
i<ElementCount Item


C

* set sentinel valueprserving the original value*
InitialValue=Item ElementCount ;
Item[ElementCount]=TestValue;
i=0;
while Item[i] =TestValue

i

* restore the value displaced by the sentinel *
Item ElementCount =Initialvalue
* check if value was found *
if i ElementCount
......
Item

C++ 6.21 4.45 28% 1 1
Pascal 0.21 0.10 52% 1 2
Basic 6.65 0.60 91% 11 1
Basic
Item


C++ 20.93 21.48 -3% 1 1
Pascal 21.42 21.97 -3% 1 1
Basic 59.84 30.07 49% 2 1

Free download pdf