+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Question # 1: 10 Marks
For the following code snippet, provide line-by-line analysis and construct function T(n) that give the runtime of this code snippet as a function of "n". Also determine the big-Oh of Best-case, Worst-case and Average case for this code snippet. [Marks: 4+2+2+2]
Search(A, Key)
i←1
while (A[i] ≠ key) and (i ≤ length[A])
i←i+1
if ( i≤ length[A])
return true
else
return false
Question # 2: 10 Marks
Find the 19thsmallest element from the array given below using Selection Algorithm (Sieve Technique);you are required to provide complete procedure along with array indexing and their values at each step.
933, 782, 116, 276, 904, 353, 416, 157, 277, 583, 525, 208, 269, 98, 181, 859, 573, 225, 526, 627, 631, 590, 257, 402, 335
Note: pivot must be the last element of the array in each iteration (i.e. q = r)
Tags:
+ 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)Thanks
Solution 100% Correct http://virtualnkn.blogspot.com/2017/11/cs502-assignment-solution.html
CS502 Helping Video Complete
good effort kindly es ko word formate ma b share kar do kal sy phly
ya sara solutions mian worst good ya bad case ko kasa calculate karna hia ya to batao pahla question main ###########################ßßßß
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents 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. 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 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