Assign3 - University of Waterloo CS240 Fall 2010 Assignment 3 Due Date Wednesday November 10 at 5:00pm Please read

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

View Full Document Right Arrow Icon
University of Waterloo CS240, Fall 2010 Assignment 3 Due Date: Wednesday, November 10, at 5:00pm Please read http://www.student.cs.uwaterloo.ca/ ~ cs240/f10/guidelines.pdf for guidelines on submission. In particular, don’t forget to make a cover page ( https://www. student.cs.uwaterloo.ca/ ~ isg/makeCover?course=cs240 ) and attach it to the front of any written assignment. There are 64 marks available. The assignment will be marked out of 60. Problem 1 [10 marks] You are given an array A of n integers such that 0 A [ i ] < k for all 0 i < n . Describe a preprocessing algorithm that runs in time O ( n + k ) and creates a data structure that allows queries of the following type to be answered in constant time: How many integers in A are in the range [ a,b ], given integers a and b with 0 a b < k ? Problem 2 [6+6+6+8=26 marks] (a) Consider the AVL tree shown in Figure ?? . Draw the tree again by adding the balance factors to all nodes (similar to slide 17 of Module 4). Draw the tree after performing operation
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 01/14/2012 for the course CS 246 taught by Professor Wormer during the Winter '08 term at Waterloo.

Page1 / 3

Assign3 - University of Waterloo CS240 Fall 2010 Assignment 3 Due Date Wednesday November 10 at 5:00pm Please read

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