COMP352_F09_assignment1

COMP352_F09_assignment1 - DEPARTMENT OF COMPUTER SCIENCE...

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

View Full Document Right Arrow Icon
COMP 352 – Fall 2009 Asiignment1 – page 1 of 2 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY COMP 352: Data Structure and Algorithms Fall 2009 ASSIGNMENT 1 Due date and time: Wednesday September 30 th by midnight Written Questions (70 marks): Q.1. Given an n-element array X of integers, algorithm A executes an O(n) time computation for each even integer stored in X, and an O(nlogn) time computation for each odd integer stored in X. What are the best-case and worst-case running times (in big-Oh notation) of algorithm A? Show all necessary calculations. Q.2. Given an n-element array X, algorithm B calls algorithm C on each element X[i] at most once (i.e., C may or may not be called). What are the best case and worst case run times of algorithm B, if (a) algorithm C runs in O(i 2 ) time when it is called on X[i]; (b) algorithm C runs in O(ilogi) time when it is called on X[i]? Show all necessary calculations. Q.3.
Background image of page 1

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

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

This note was uploaded on 03/25/2010 for the course COMP COMP352 Ho taught by Professor Guy during the Spring '10 term at Concordia Canada.

Page1 / 2

COMP352_F09_assignment1 - DEPARTMENT OF COMPUTER SCIENCE...

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