Complexity - CS 2606 Data Structures & OO Devel II...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 2606 Data Structures & OO Devel II Homework 1: Complexity Last modified: 9/10/2007 7:44:31 AM 1 You will submit your solution to this assignment to the Curator System (as HW1 ). Your solution must be either a plain text file (e.g., NotePad) or a MS Word document; submissions in other formats will not be graded. Partial credit will only be given if you show relevant work. 1. Consider the following algorithm: string BinaryRep; // Line 1 if (numBytes <= 0) return BinaryRep; // 2 BinaryRep = ByteToString(p[0]); // 3 for ( int Byte = 1; Byte < numBytes; Byte++) { // 4 BinaryRep = ByteToString(p[Byte]) + " " + BinaryRep; // 5 } a) [15 points] Using the rules given in the course notes, perform an exact count worst-case complexity analysis of the algorithm above, and state the corresponding function T(N). N is numBytes , and the body of ByteToString() executes 30 instructions. Variable declarations don't require any operations we're counting....
View Full Document

This note was uploaded on 04/14/2008 for the course CS 2606 taught by Professor Wdmcquain during the Fall '07 term at Virginia Tech.

Page1 / 2

Complexity - CS 2606 Data Structures & OO Devel II...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online