CS502 Fundamentals of Algorithms Assignment No 01 Spring 2019 Solution & Discussion Due Date: 15-05-2019
Question No 01: (Marks: 10)
The following algorithm (procedure) is computing the multiplication of two squared matrices. A[][] and B[][] are two squared matrices, Mul[][] is a square matrix which store the multiplication of A[][] and B[][]. As the matrices are squared so, “n” would be the number of columns or rows. You are required to calculate the worst case time complexity {T(n)} of this algorithm.
1 Matrix_Multiplication (A[][], B[][],Mul[][], int n)
2 Sum = 0
3 for (int i to n)
4 for (int j to n)
5 for (int k to n)
6 Sum = Sum + A[i][k] * B[k][j];
7 Mul[i][j] = Sum;
Note: Make sure that the alignment of each step/line is important in the algorithm, because it may indicate you that the loops are nested or in sequence.
Question No. 02 (Marks 10)
Consider the following function f(n) which represent the time complexity of an algorithm.
f(n) = 2n^{2} + 4n + 7
As per the definition of Big O, we have, 0 ≤ f(n) ≤ cg(n) , where c >0 and n ≥ n_{0}
If g(n) = n^{2} , find the value of c for which the upper bound cg(n) holds.
=====================================Ended=======================================
For any query about the assignment, contact at CS502@vu.edu.pk
GOOD LUCK
Tags:
Please Discuss here about this assignment.Thanks
Our main purpose here discussion not just Solution
We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>
Discussed & be touched with this discussion. After discussion a perfect solution will come in a result at the end.
“How to Join Subject Study Groups & Get Helping Material”
P.S: Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”
isk solution bhe discuss krea ga yhn pa please....
*********
Koi tu solution upload kr da
Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....
This is just an Idea about worst case time
Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....
Share below link with friends for solution & Discussion.
CS502 Assignment#01 Spring 2019 Solution
@Tariq Sir ... can we have a clear image as few of the things r not readable.
moreover i wanted to speak to you for years now. left few msgs in inbox but never get the reply.
i'll be grateful if can have a quick min of yours.
© 2021 Created by + M.Tariq Malik. Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.
We are user-generated contents & non-commercial site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. All Contents on site are for personal & non-commercial use.We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post