This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 433-521 Algorithms and ComplexityProject 1First Semester 2009Posted on LMS: Wednesday, 11 March 2009Due: Wednesday, 18 March 2009 [9.05am]Important:Your submissions for this project must be your own individual work. There is a furthernotice about this at the end of this document.Questions1 [2 marks]Order the following functions according to their order of growth (from lowest to high-est):(n−2)!5 log2(n+ 100)1022n.001n4+ 2n3+ 1(lnn)23√n3n.[based on Levitin, 2.2.5, p60]2 [2 marks]Find the order of growth of the following sums.(i)nsummationdisplayi=1(i+ 1)2i-1(ii)n-1summationdisplayi=0i-1summationdisplayj=0(i+j).[based on Levitin, 2.3.2, p67]3 [3 marks]As stated in the text [pp47–8], the worst-case number of key comparisons in the classicSEQUENTIALSEARCH algorithm isn, while the best case number is1.Algorithm 1SEQUENTIALSEARCH(A[0..n−1],K)Require:An arrayA[0..n−1]and a search keyK.Ensure:Returns the index of the first element ofAthat matchesK, or−1if there are no matchingelements.elements....
View Full Document
This note was uploaded on 05/11/2010 for the course COMPUTER S 301 taught by Professor . during the Spring '10 term at Kadir Has Üniversitesi.
- Spring '10