Q18_146_20250805105359.webp
G

Q18_146_20250805105359.webp

  • Media owner Grey93
  • Ngày thêm
☑Kizspy.me
(Choose 1 answer)
☐ A
☐ E
Which of the following procedures are recursive algorithms?
(i) procedure tt1(x: int, n: positive int)
d:=0
for i=1 to n do
d:=d+x
print(d)
(ii) procedure tt2(x: int, n: positive int)
If n=1 then tt2(x,n):=x
else tt2(x,n): tt2(x,n-1)+x
(iii) procedure tt3(n: positive int)
S:=0
For i=1 to n do
s:=s+n
Print(s)
(iv) procedure tt4(n: positive int)
If n=1 then tt4(n):=1
else tt4(n): tt4(n-1)+n;
A. (iii), (iv)
B. (i), (ii)
C. (ii), (iv)
D. (i), (iii)
E. None of the other choices is correct
FUQ.sh
sh the exam.

Thông tin

Category
MAD101
Thêm bởi
Grey93
Ngày thêm
Lượt xem
1,790
Lượt bình luận
6
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom