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

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

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

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 No. 02
Semester: Fall 2015

CS502: Fundamentals of Algorithms

Due Date:07/12/2015

Instructions

Please read the following instructions carefully before submitting assignment:

 

It should be clear that your assignment will not get any credit (zero marks) if:

  • The assignment is submitted after due date.
  • The submitted assignment is other than .doc file.
  • The submitted assignment does NOT open or file is corrupted.
  • The assignment is copied (from other student or ditto copy from any other source).

 

Objective

 

The objective of this assignment is to enable students:

 

  • Write and solve recurrence relations of recursive algorithms using iteration method
  • Design algorithm using Divide and conquer approach

 

Submission

 

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

                                                             GOOD LUCK

 

Question 1:

 

Consider the following recursive algorithm for computing the sum of the first n squares:

Sum(n) = 12 + 22 + . . . + n2.

 

Algorithm: SUM(n)

if n = 1 return 1

else return SUM(n − 1) + n ∗ n

 

Write recurrence relation for above algorithm and solve it using Iteration Method.

 

Question 2:

 

In Divide and conquer strategy, three main steps are performed:

 

  1. 1.      Divide: Divides the problem into a small number of pieces
  2. 2.      Conquer: Solves each piece by applying divide and conquer to it recursively
  3. 3.      Combine: Combines/merges the pieces together into a global solution.

 

Write an algorithm to find minimum number from a given array of size ‘n’ using divide and conquer approach.

 

 

Lectures Covered:  This assignment covers first 15 Lectures.

Deadline:             Your assignment must be uploaded/submitted at or before 07 Dec, 2015. 

+ 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: 17816

.

+ 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

ye kis question ka solution hy /

koiiiiiiiiiiiiiiiiiiiii hhhhhhhhhhhhhhhhhh

y thk h??

tehk he hoge ab to submit be krva di

pata nh thk h b ya nh

kaun si submit ki share hi kar do

submit karain assignment sol

Y LO 

Attachments:

ya corrct h ya phly wali

Slove of Question 2 divide and conquer technique

Algorithm to find minimum number

If (p=r)        // here we supposing n is equal to one

Then return A[p]

Else <-- Choose_Pivot (A, p, r)     //if n is not equal to 1 then select a pivot

q <-- Partition (A, p, r, x)      ...................//then divide the array 

if rank_x= 1 ................../// if the rank of pivot element after partition is 1

then return x   ... //then this pivot element is the minimum number in array

else //if rank_x > 1           //// otherwise proceed recursively                      

then return Select( A, p, q-1, 1)

thanks to zain in for guidance

RSS

Latest Activity

彡JK彡 ❤️ liked + M.Tariq Malik's discussion Everyone Freelancer Must Watch it - Most important video for Every fiver user
22 minutes ago
彡JK彡 ❤️ replied to +¢αяєℓєѕѕ gιяℓ's discussion Mera tu Mohabbat se aitbar.............:-P
23 minutes ago
彡JK彡 ❤️ liked +¢αяєℓєѕѕ gιяℓ's discussion Mera tu Mohabbat se aitbar.............:-P
24 minutes ago
彡JK彡 ❤️ replied to ٹمبکٹو's discussion محبّت اور دل - عشق مجازی
25 minutes ago
彡JK彡 ❤️ liked ٹمبکٹو's discussion محبّت اور دل - عشق مجازی
25 minutes ago
فقیہہ اقدس liked ٹمبکٹو's discussion محبّت اور دل - عشق مجازی
1 hour ago
Choudary Nafees Ejaz commented on + M.Tariq Malik's group STAT404 Regression and Correlation
3 hours ago
Choudary Nafees Ejaz joined + M.Tariq Malik's group
4 hours ago
Choudary Nafees Ejaz liked + M.Tariq Malik's group STAT404 Regression and Correlation
4 hours ago
MUHAMMAD KASHIF replied to + M.Tariq Malik's discussion ENG506 World Englishes Assignment No 01 Fall 2019 Solution & Discussion in the group ENG506 World Englishes
6 hours ago
MUHAMMAD KASHIF joined + M.Tariq Malik's group
6 hours ago
+ M.Tariq Malik replied to ayesha's discussion CS614 Assignment NO.1 Fall 2019 Solution&Discussion Due date: 14 Nov 2019 in the group CS614 Data Warehousing
6 hours ago
+ M.Tariq Malik replied to ayesha's discussion CS614 Assignment NO.1 Fall 2019 Solution&Discussion Due date: 14 Nov 2019 in the group CS614 Data Warehousing
6 hours ago
Profile IconKhadija Naveed, Muhammad Abdullah, maha khan and 6 more joined Virtual University of Pakistan
6 hours ago
MUHAMMAD KASHIF replied to + M.Tariq Malik's discussion ENG505 Language Learning Theories Assignment No 01 Fall 2019 Solution & Discussion in the group ENG505 Language Learning Theories
6 hours ago
MUHAMMAD KASHIF joined + M.Tariq Malik's group
6 hours ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion CS201 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 14-11-2019 in the group CS201 Introduction to Programming
6 hours ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion PAK301 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 21-11-2019 in the group PAK301 Pakistan Studies
6 hours ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion PAK301 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 21-11-2019 in the group PAK301 Pakistan Studies
6 hours ago
+ M.Tariq Malik replied to Rana Ali's discussion EDU201 Learning Theories Assignment No 01 Fall 2019 Solution & Discussion in the group EDU201 Learning Theories
6 hours ago

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

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