# ex1 - A.V.Gerbessiotis Exam 1 CIS 435 2-13-03 Spring03 Exam...

This preview shows pages 1–3. Sign up to view the full content.

A.V.Gerbessiotis CIS 435 Spring03 Exam 1 2-13-03 Exam 1 Name: ................................................................. ID Number: ....................... Grade: 1: . .... 2: . .... 3: . .... 4: . .... Total: . .......... Exam 1 Sections 435-002, 435-004, 435h Solve all the problems in the space provided. 45 minutes for 100 points Read the Problems CAREFULLY! There are 3 (THREE) pages this page included Formulae to remember n X i =1 i = n ( n + 1) 2 , n X i =1 i 2 = n ( n + 1)(2 n + 1) 6 , n X i =1 i 3 = n 2 ( n + 1) 2 / 4 , n ! ± n e ² n , a log b n = n log b a , For x 6 = 1, k - 1 X i =0 x i = ( x k - 1) / ( x - 1) k - 1 X i =0 ix i = kx k ( x - 1) - x k +1 + x (1 - x ) 2 InsertionSort(A[1. .n]) MergeSort(A[1. .n]) 1. for (j=2;j<=n;j++){ 1. MergeSort(A,1,n); 2. key= A[j]; 3. i=j-1; MergeSort(A,l,r) 4. 1. if (l < r) { 5. A[i+1]= A[i]; 2. m=floor((l+r)/2); 6. i=i-1;} 3. Merge-Sort(A,l,m); 7. A[i+1]=key; 4. Merge-Sort(A,m+1,r); } 5. Merge(A,l,m,r); }

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Problem 1 (24 points)
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/29/2010 for the course CS CS 435 taught by Professor Alex during the Spring '09 term at NJIT.

### Page1 / 3

ex1 - A.V.Gerbessiotis Exam 1 CIS 435 2-13-03 Spring03 Exam...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online