بسم الله الرحمن الرحيم
السلام عليكم ورحمة الله وبركاته
كيفكم ان شاءا لله بخير
كنت مسجله بعضويه ثانيه بس لي فتره ما دخلت ومو عارفه بأي ايميل كنت مسجله :(
ع العموم انا بحاجه لمساعدتكم بشرح هذي الاسئله لي
ما ابي اجوبه لكن لغة السي بلس بلس مو من ضمن تخصصي ,, لان تخصصي جافا وللأسف مو فاهمه شي ,,لان الشرح للماده غير مكثف والواجب ينزل بجزئيات للان ما وصلنا لها :)
وياليت الشرح يكون بذكر امثله عشان اقدر استوعب الفكره مو بس أحلهم
وراح اكون شاكره لكم
وهذي الاسئله
The algorithm below finds the difference S of two arrays A[0..n-1] and B[0..n-1] of n elements. The resulting array S[0..n-1] is an array of the elements S = A - B
ALGORITHM subtractArrays(A[0..n-1], B[0..n-1]) // Input: Two arrays A and B of n elements // Output: Array S = A - B for i←0 to n-1 do S ← A - B output S[0..n-1]]
(a) What is the algorithm’s basic operation?
(b) How many times is the basic operation executed?
© Determine the class O(?) the algorithm belongs to.
السؤال الثاني
Assume you have the below algorithm, answer the below questions
Algorithm Mystery(A[0..n-1 ], int n)
//Input: an array A and n is the array size
//Output:
if (n == 1)
return a[0]
else
return (a[n-1] + sum_of(a,n-1))(a) Trace the algorithm on array A = (4, 3, 6, 2, 5)
(b) What is the overall time complexity of the algorithm?
© What does the algorithm compute?
السؤال الثالث
Use Merge Sort to sort the following array. What is the time complexity of Merge Sort?
12 3 5 9 20 7 1 13
ياليت تشرحولي ايش الملطوب
شيء آخر
حابه أعرف ايش اهم الأساسيات اللي المفروض افهمها وأعرفها بلغة السي بلس بلس