We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search


+ Link For Assignments, GDBs & Online Quizzes Solution


+ Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Assignment No. 01
Semester: Spring 2016
CS502: Fundamentals of Algorithms
Total Marks: 20

Due Date:19/05/2016

Please read the following instructions carefully before submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:
o The assignment is submitted after due date.
o The submitted assignment is other than .doc file.
o The submitted assignment does NOT open or file is corrupted.
o The assignment is copied (from other student or ditto copy from any other source).


The objective of this assignment is to:

 Learn and practice Algorithm running time analysis
 Solve recurrences using iteration method


You are required to submit your solution through LMS as MS Word document.

For any query about the assignment, contact at CS502@vu.edu.pk

Question 1:
Analyze the running time complexity of the following piece of code. Show your working step by step.

SumOddEven(A,n) //A is array and n is size of array
int count, sum;
for(int i = 1; i<=n; i++) { sum_even=0; sum_odd=0; for(int j = i; j<=n; j++) { if (A[j] Mod 2 == 0) //check if number is even sum_even=sum_even+A[j] //Sum even numbers else sum_odd=sum_odd+A[j] //Sum odd numbers } cout/p>

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

See Your Saved Posts Timeline

Views: 12684


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Replies to This Discussion


yr full solution file send karo

wasfa ny full hi solution send kia almost first question wrong krny sy better tha jo proper method usko solve krny ka bus wohi wasfa ny share kia hy .... :)

in Question 1 They Asked about Time Complicity LOL what did u do in Solution
This Answer is also Wrong

analysis ki jga,,,complexity likh lo... :P

thnx wasfa

I Got Final Answer After Admin Warn me on FaceBook Programming Group

what's the final answer then?

hey agr meri assignmnt rong hui to plzzz mje BadDuaen na dena..bcz mje cnfrm ni abt my assignmnt,,jo smjh i bna li :(

idea sol Q.1


Yeah This is Right Answer

for(int j = i; j<=n; j++) yaha p n+1 time chaly ga ek time n k leye ek time condition false k leye


Latest Activity

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service