الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

BigO and Time Of algorithm Steps

بدأه Neo_2010 في 9 ديسمبر 2009 · 2 رد · 1,374 مشاهدة · في الرياضيات والخوارزميات
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

For (I=1 through N)

2 For (j=1 through I)

3 For (k= 1 through 5)

Task T

Task T requires t time units

The third For (inner loop) requires 5 * t

The second For requires 5 * t * I

The first For requires (as function of I):

5*t*1 + 5*t*2+…+5*t*N= 5*t(1 +2 +…+N)

= 5*t(N+1)*N/2 time units

1 For (I=1 through N/2)

2 For (j=1 through 2I)

3 For (k= 1 through 5)

Task T

The third For (inner loop) requires 5 * t,

The second For requires 5 * t * 2i,

The first For requires (as function of I):

5*t*20 + 5*t*21 + 5*t*22+…+5*t*2N/2

5*t(1+2+4 +…+2N/2)

= 5*t(2N/2+1 -1) time units, N is even

= 5*t(2(N+1)/2 -1 + 2N/2) time units, N is odd

ارجو شرح مفصل للامثلة و ايضا المثالين الموجود فى المرفقات صفحة 2و3

و لكم جزيل الشكر

Performance_analysis.pdf

#2

الامثله مشروحة اخي، غلب حالك شوي وترجم واذا هناك جزء غير واضح استفسر عنه.

الحمد لله الذي هدانا لهذا وماكنا لنهتدي لولا ان هدانا الله

#3

Dear My Brother,I know that all samples are answered but I need to know How to Solve This simple Example to Get Running time for more complex problems Like

For(int i = n ; n >= 1 ; n=n/3)

for(int j=0 ; j <= i ; j++)

print(i+j);

Also i need to Get Efficiency of Sorting Algorithms By myself ,Not by read them from the book

مواضيع مشابهة