We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>
+ 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 CS502 Fundamentals of Algorithms 
Total Marks: 20
Due Date: 28/05/2020 

Instructions Please read the following instructions carefully before solving & submitting assignment: It should be clear that your assignment will not get any credit if: · The assignment is submitted after due date. · The submitted assignment does not open or file corrupt. · The assignment is full or partially copied from (other student or ditto copy from handouts or internet). · Student ID is not mentioned in the assignment File or name of file is other than student ID. · The assignment is not submitted in .doc or .docx format. Uploading instructionsYour submission must include:
· Assignment should be in .doc or .docx format. · Save your assignment with your ID (e.g. bx180200786.doc). Assignment submission through email is NOT acceptable ObjectiveThe objective of this assignment is · To give basic knowledge and understanding of Algorithms. · To be able to design simple algorithms. · To be able to understand and calculate the complexity of algorithms.
Note: Your answer must follow the below given specifications. · Font style: “Times New Roman” · Font color: “Black” · Font size: “12” · Bold for heading only. · Font in Italic is not allowed at all. · No formatting or bullets are allowed to use. · Your answer should be precise and to the point, avoid irrelevant detail.
Lectures Covered: This assignment covers Lecture # 01  08 Deadline Your assignment must be uploaded/submitted at or before 28/05/2020.
Assignment Statement:
Palindrome is a number which does not change even if we reverse its digits. For example, 121, 1331, 16561 etc, while 122, 2354, 25486 etc are not palindromes. There may be many algorithms which can be written for the identification of a number to be palindrome or not palindrome.
Question No 01: (Marks: 10) You are required to design (write) a simple algorithm (Only Pseudo code) which can identify a number to be Palindrome or Not Palindrome.
Question No 02: (Marks: 10) You are required to calculate (Step by Step) the worst case time complexity T(n) of the algorithm designed in Question No. 01.
=====================================Ended=======================================
For any query about the assignment, contact at CS502@vu.edu.pk
GOOD LUCK 




Tags:
+ 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?.
+ 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)Please Discuss here about this assignment.Thanks
Our main purpose here discussion not just Solution
Students having same subject can start discussion here to solve assignment, GDB & Quiz and can clear their concepts until solution is provided.
P.S: Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”
Then copy Questions from assignment file and paste in Discussion.
+ http://bit.ly/vucodes (For Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (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)
CS502_Assignment_No_01_Solution_Spring_2020
Download the file, Click on the below link
CS502 Assignment 1 Solution SPring 2020
here its Detail about Your assignment but please don't try to copy and pasting system i'll provide you solution but you use it and customise it according to your needs Thanks
#CS502assignment1solution2020
cs502 assignment 1 SOLUTION spring 2020 Correct solved Complete
CS502 Assignment 1 Complete Solution Spring 2020,CS502 Assignment 1 Complete Solution,CS502 Assignment 1,CS502,CS502 assignment 1 solution,CS502 assignment spring 2020,CS502 assignment solution spring 2020,CS502 assignment, assignment 1 CS502 solution, solution CS502 assignment 1, Cs502 assignment 1 solution 2020,Cs502 assignment solution 2020,Cs502 assignment 1,Cs502 assignment 1 solution spring 2020,Cs502 assignment no 1 solution spring 2020,Cs502 assignment no 1 solution 2020,Cs502 1st assignment solution 2020,Cs502 1st assignment solution,Cs502 1st assignment solution spring 2020,assignment solution spring 2020,CS502 Assignment 1 Complete Solution Spring 2020,CS502 Assignment 1 Complete Solution,CS502 Assignment 1,CS502,CS502 assignment 1 solution,CS502 assignment spring 2020,CS502 assignment solution spring 2020,CS502 assignment, assignment 1 CS502 solution, solution CS502 assignment 1 CS502 : Fundamentals of Algorithms
#CS502assignment1solution2020
CS502 Fundamentals of Algorithms Assignment 1 Solution & Dicussion Spring 2020
Solution Credit: @mc190203271
Question No 01: (Marks: 10)
You are required to design (write) a simple algorithm (Only Pseudo code) which can identify a number to be Palindrome or Not Palindrome.
Solution:
int x;
reverse = 0:
while (x>0)
reverse = reverse + x % 10);
x / = 10;
if ( x = reverse )
then
number is palindrome
Else
number is not palindrome
Question No 02: (Marks: 10)
You are required to calculate (Step by Step) the worst case time complexity T(n) of the algorithm designed in Question No. 01.
Solution:
frequency
int n; 1
reverse = 0; 1
while (n>0) n
reverse = reverse + n % 10; n
n / = 10; n
if ( n = reverse) 1
then 1
number is palindrome 1
else 1
number is not palindrome 1
so time complexity of above algorithm would be as follows:
T(n) = 1+1+n+n+n+1+1+1+1+1
T(n) = n + 9
From the above equation the highest degree is n so its complexity is linear. This is the worst case time complexity of the above algorithm is T(n).
How sum of T(n) = 1+1+n+n+n+1+1+1+1+1 can be n + 9?
#CS502 #CS502Assignment1Spring2020 #CS502_Assignment1
CS502 Assignment No 1 Solution Spring 2020  Virtual University 
CS502 Assignment 1 Solution Spring 2020 Virtual University of Pakistan
Complete Guidance of Assignment CS502 Spring 2020
#CS502
#CS502Assignment1Spring2020
Cs502 assignment 1
cs502 assignment no 1 spring 2020
cs502 Fundamentals of Algorithms spring 2020
Virtual University of Pakistan
VU of Pakistan
VU.edu.pk
#CS502_Assignment1Spring2020
#CS502Spring2020
Correct Solution For CS502 Assignment No.1 Spring 2020 uploaded by VU
Solution:
Question No. 01: The algorithm for the identification of Palindrome number is as follows,
Question No. 02: The step by stem analysis of the algorithm designed in question 1 is as follow,
The time taken by each statement (step) is given as follows,
Step 1: C_{1} // Execute only 1 time or Constant Time or O (1)
Step 2: C_{2} // Execute only 1 time or Constant Time or O (1)
Step 3: C_{3} // Execute only 1 time or Constant Time or O (1)
Step 4: [log(num)/log(10)] +1 // Execute [log(num)/log(10)] +1 times
Step 5: [log(num)/log(10)] +1 // Execute [log(num)/log(10)] +1 times
Step 6: [log(num)/log(10)] +1 // Execute [log(num)/log(10)] +1 times
Step 7: [log(num)/log(10)] +1 // Execute [log(num)/log(10)] +1 times
Step 8: C_{4 } // Execute only 1 time or Constant Time or O (1)
Step 9: C_{5 } // Execute only 1 time or Constant Time or O (1)
Step 10: C_{6 } // Execute only 1 time or Constant Time or O (1)
Step 11: C_{7 } // Execute only 1 time or Constant Time or O (1)
Total time T(n) can be calculated as follows,
T(n) = C_{1} + C_{2} + C_{3} + [log(num)/log(10)] +1 +[log(num)/log(10)] +1 +[log(num)/log(10)]
1 + [log(num)/log(10)] +1 + C_{4} + C_{5} + C_{6} + C_{7}
T(n) = C_{1} + C_{2} + C_{3} + C_{4} + C_{5} + C_{6} + C_{7}+ 4+ 4[log(num)/log(10)]
T(n) = C_{8} + 4[log(num)/log(10)] // C_{8} = (C_{1} + C_{2} + C_{3} + C_{4} + C_{5} + C_{6} + C_{7} +4)
T(n) = log(num) / log(10) // Ignoring constant terms
T(n) = log(n) / log(10) _{ }// If num = n ( or replace num with n)
Or T(n) = O (log (n) / log (10)_{ }
© 2020 Created by +M.Tariq Malik. Powered by
Promote Us  Report an Issue  Privacy Policy  Terms of Service
VU Students reserves the right to delete profile, which does not show any Activity at site nor has not activity more than 01 month.
We are usergenerated 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 m.tariqmalik@gmail.com or Contact us at contact Page 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