تم الحل ✓
categoryعلوم الحاسوب وتقنية المعلومات
schoolبكالوريوس
event_available2026-07-13
السؤال
Transcribed Image Text:
Consider the three following pieces of pseudocodes. In each case,
(a) Give the number of times "Hello" will be printed
(b) Generalize giving the number of times as a function of n
(c) Express this in O notation in terms of n.
(a)
set n=32
set i=1
while i <= n
print "Hello"
i=1*2
endwhile
(b)
set n=4
set i=1
while i <= n
print "Hello"
i=1+2
endwhile
(c)
set n=4
set i 1
while i < n
set j=1
while j <= i
print "Hello"
j=j+1
endwhile
i=i+1
endwhile
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.