DOC PREVIEW
GSU CSC 2320 - Quiz 1 Key

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSCI 2320 Data StructureQuiz 1 Name:__________________Question1:Determine the Big O( ) notation for the following: (60 pts)1. n3 + n3 O(n3)2. 10n3 + 2n5+ 200n2+ 30n3+ 10n3 + 2n5+ 200n O(n5)3. n(10n3 + 50m) O(n4+mn)4. 30n3( 2n5+ 200n) O(n8)5. (0.1 n3 + 75 k2) m O(n3m + k2m)6. (m + n)(10n3 + 50n) O(mn3+ n4)Question2: Please read into the following code and determine:(1) In terms of m, n, please determine the following code’s O ( n2+m ) (20 pts)(2) In your own words, what is the code doing? (20 pts)Find the minimum continuous sum for 2 arrays (a and b) with 2 different approaches.One cost O(n2) while the other cost O(m)int minSubSum(int a[], int b[]){ int n = a.size(); int minSum = 0; for(int i = 0; i < n; i++){ int thisSum = 0;for(int j = i; j < n; j++){ thisSum += a[j];if( thisSum < minSum){ minSum = thisSum; seqStart = i; seqEnd = j; } } } cout<<minSum; int m = b.size(); int thisSum = 0, minSum = 0; int i=0; for( int j = 0; j < m; j++){thisSum += a[j];if( thisSum < minSum){minSum = thisSum;seqStart = i;seqEnd = j;}else if( thisSum > 0) {i = j + 1;thisSum = 0;} } cout<<minSum;


View Full Document

GSU CSC 2320 - Quiz 1 Key

Download Quiz 1 Key
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Quiz 1 Key and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Quiz 1 Key 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?