hw_04 - CS 473: Fundamental Algorithms, Spring 2012...

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

View Full Document Right Arrow Icon
CS 473: Fundamental Algorithms, Spring 2012 Homework 4 (due Tuesday, 23:55:00, February 21, 2012) See homework 1. Each student individually have to also do quiz 4 online. Version: 1.2 1. ( 30 pts. ) Counting significant inversions. Let a 1 ,a 2 ,...,a n be a sequence of n integers. A pair ( i,j ) with 1 i < j n is said to be an inversion if a i > a j . Given a sequence suppose we wish to find the total number of inversions in the sequence. There is an O ( n log n ) time algorithm based on divide-and-conquer for this problem (see Kleinberg-Tardos Section 5.3 if you cannot figure this out). Consider variant of the problem where we say that pair ( i,j ) with 1 i < j n is an important inversion if a i > 10 a j . Describe an O ( n log n ) time algorithm for counting the important inversions in a given sequence. 2. ( 35 pts. ) Planning road trip. You are going on a long trip. You start on the road at mile post 0. Along the way there are
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 04/02/2012 for the course CS 473 taught by Professor Chekuri,c during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 2

hw_04 - CS 473: Fundamental Algorithms, Spring 2012...

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