10
www.vustudents.ning.com Search Sign Up Sign In www.vustudents.ning.com Home Chat MyPage Members Forum Study Zone Blog Videos Photos Leaderboards Contact Us Study Groups By Subject code Wise (Click Below on your university link & Join Your Subject Group) [+ VU Study Groups Subject Code Wise ][+ COMSATS Virtual Campus Study Groups Subject Code Wise ] Looking For Something at vustudents.ning.com?Search Here Search CS502 Assignment No. 02 Solution & Discussion Due Date: Dec 07, 2015 Posted by + M.Tariq Malik on December 1, 2015 at 4:31pm in CS502 Fundamentals of Algorithms Back to CS502 Fundamentals of Algorithms Discussions CS502 Assignment No. 02 Solution & Discussion Due Date: Dec 07, 2015 CS502 Fundamentals of Algorithms Assignment No. 02 Solution Fall 2015 Due Date Dec 07, 2015 ► Assignment ► Submission ► Solution ► PPT Slides Ads by Google

CS502 Assignment No. 02 Solution & Discussion Due Date

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

www.vustudents.ning.com
Home Chat MyPage Members Forum Study Zone Blog Videos Photos Leaderboards Contact Us
Study Groups By Subject code Wise (Click Below on your university link & Join Your Subject Group)
[ + VU Study Groups Subject Code Wise ]  [ + COMSATS Virtual Campus Study Groups Subject Code Wise ]
Looking For Something at vustudents.ning.com?Search Here
  Search
CS502 Assignment No. 02 Solution & Discussion Due Date: Dec 07, 2015
Posted by + M.Tariq Malik on December 1, 2015 at 4:31pm in CS502 Fundamentals of Algorithms Back to CS502 Fundamentals of Algorithms Discussions
CS502 Assignment No. 02 Solution & Discussion Due Date: Dec 07, 2015
CS502 ­ Fundamentals of Algorithms Assignment No. 02 Solution Fall 2015 Due Date Dec 07, 2015
   Assignment    Submission    Solution    PPT SlidesAds byGoogle
CS502: Fundamentals of Algorithms
 
It should be clear that your assignment will not get any credit (zero marks) if:
 
 
 
 
 
                                                             GOOD LUCK
 
Consider the following recursive algorithm for computing the sum of the first n squares:
Sum(n) = 12 + 22 + . . . + n2.
else return SUM(n − 1) + n ∗ n
 
 
 
 
 
 
Deadline:             Your assignment must be uploaded/submitted at or before 07 Dec, 2015. 
Tags:&, 02, 07, 2015, Assignment, CS502, Date:, Dec, Discussion, Due, More…
Promote 3 members promoted this + Click Here To Join also Our facebook study Group.
+ Prohibited Content On Site + Report a violation + Report an Issue
You, Sana Khattak and 60,047 others like this.
Like Share
Replies to This Discussion
Permalink Reply by White_rose *MCS* on December 8, 2015 at 4:53pm
plzzzzzzzzzz jaldi sy bta dyn knsa solution kis question ka hy???
or knsa solution theek hy???
Permalink Reply by humayla idrees on December 8, 2015 at 5:16pm
part 1 ist ka ....  auer part 2 scnd ka .........scnd ka answr mjhe cnfrm nhe :)
 
1Like
 
Consider the following recursive algorithm for computing the sum of the first n squares:
Sum(n) = 12 + 22 + . . . + n2.
 
 
Write recurrence relation for above algorithm and solve it using Iteration Method.
Answer:
            T(n) = 2kT (n/(2k)) + (n+n+n+....+n)
             = n + n log n
 
 
Write an algorithm to find minimum number from a given array of size ‘n’ using divide and conquer approach.
Answer: Denoting S(n) the sum of the first n cubes, S(n) must be a polynomial of the fourth degree in n, let
S(n) = an^4+bn³+cn²+dn
This is because
1)         S(0)= 0, so there is no independent term
2)         When computing S(n)­S(n­1), which must equal n³, you get a polynomial of the third degree, by cancellation of the quartic term:
 S (n)­S(n­1) = a(n^4­(n­1)^4)+b(n³­(n­1)³)+c(n²­(n­1)²)+d(n­(n­1)).
Developing and simplifying
a(4n³­6n²+4n­1)+b(3n²­3n+1)+c(2n­1)+d = n³.
Let us identify the coefficients.
n³:  4a       = 1   n²: ­6a + 3b    = 0  
n:   4a ­ 3b + 2c = 0   1:   ­ a + b – c + d = 0  Solving this triangular system is straightforward:
a= 1/4   b= 1/2   c= 1/4   d= 0
So,
Dittos Virtual Copied Merges Assignment Solutions
Permalink Reply by Qamer on December 8, 2015 at 5:53pm
YE theak hy ya galat ?
Part1  T(n)=T(n­1)+n*n as we know that T(n­1)=T(n­2)+n*n so we put this value   T(n)=T(n­2)+n*n+n*n =T(n­2)+2(n*n)  T(n)= T(n­2)+2(n*n) T(n­2)=T(n­3)+n*n so we put this value  T(n)= T(n­3)+2(n*n)+n*n= T(n­3)+3(n*n)   T(n­3)+3(n*n) T(n­3)=T(n­4)+n*n so we put this value  T(n)=T(n­4)+3(n*n)+n*n=T(n­4)+4(n*n)  .......... T(n)= T(n­k)+k(n*n)  If we set n=k  Then  T(n)= T(n­n)+n(n*n)=n^3
Part2:  SELECT(Array A,int p ,int r,int k=1)  if(p=r)   then return A[p]  else x  CHOOSE_PIVOT(A,p,r)  q   PARTITION (A,p,r,x)  rankx   q­p+1  if k= rankx  then return x  if k< rankx  then return SELECT(A, p ,q­1, k)
Permalink Reply by White_rose *MCS* on December 8, 2015 at 7:05pm
confuse ho gy hyn knse solution theek hy in ma sy???????????????
koi oto Allah ka bnda theek sy guide kr dy...............
Permalink Reply by adnan shahid on December 8, 2015 at 8:58pm
FIRST QUESTION THEK HAI.  PLEASE EXPLAIN ANYONE 2ND ONE WHO UNDERSTANDS THE 2ND ONE???/
Permalink Reply by Qamer on December 8, 2015 at 7:19pm
Permalink Reply by White_rose *MCS* on December 8, 2015 at 7:36pm
dooor kryn plzzzzzzzzzzzzz jinhyn sahi smjh aai hy
Permalink Reply by Adnan Khan on December 8, 2015 at 8:25pm
conform answer konsa hai ?
Permalink Reply by Atta Ur Rehman on December 8, 2015 at 8:21pm
Permalink Reply by + M.Tariq Malik on December 8, 2015 at 9:02pm
CS502 complete solution 2015
Permalink Reply by luqman on December 8, 2015 at 9:05pm
bro r u sure about this
‹ Previous 1 …
5 6 7 8 9 10 Next › Page 8   Go
RSS
1. test phase
2. GDB No. 02 (Due Date 14­12­2015)
Posted by  Þε¢ιoù♥_♥M¢υεεñ on December 8, 2015
3. MGT 611 assignment no.1 fall 2015
Posted by naimakhan on December 11, 2015
More…
Select Any One Category
+ Latest Activity In Forum
+ Newest Discussions In Forum
+ îî Μ  promoted + "SANA (EXVU))+'s discussion Request for Pray .. 3 hours ago
+ îî Μ  replied to + "SANA (EXVU))+'s discussion Request for Pray .. 3 hours ago
+ îî Μ  replied to +*åñå ƒåå*'s discussion Girlzzz vS BOYzzz Competition.... 3 hours ago
attia updated their profile 3 hours ago More Latest Activity? Click Here
Concrete Mixers For
Sale
All Kinds Of Concrete Mixers For Sale Good Quality&Lower Price
Site Info
+ About Us + 58000+ Members + VUSTUDENTS Toolbar + Become a Team Member + Moderators Group + Safety Guidelines for New + Site FAQ & Rules + Safety Matters + Online Safety + Terms of Service + Disclaimer + Report an Issue + Advertise with Us + Rules For Blog Post + Prohibited Content On Site + Report a violation + Important for All Members Take a Look
Management: Admins ::: Moderators
Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service
Site Leaderboards + Top Members This Month  + Top Members This Week  + Top Members Today + Top Content This Month  + Top Content This Week  + Top Content Today + Top Photos This Month  + Top Photos This Week    + Top Photos Today + Top Blog Posts This Month  + Top Blog Posts This Week  + Top Blog Posts Today + Top Videos This Month  + Top Videos This Week  + Top Videos Today + Top Discussions This Month + Top Discussions This Week  + Top Discussions Today
  We are user­generated contents site. All product, videos, pictures & others contents on vustudents.ning.com don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at [email protected] or Contact us at contact Page with copyright detail & We will happy to remove it immediately.
About Site | Promote Us | Report an Issue | Privacy Policy | Terms of Service | Disclaimer | Advertise | Prohibited Content On Site
Copyright © VU Students.Ning Chat With Online Members!