{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw_04 - CS 473 Fundamental Algorithms Spring 2012 Homework...

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

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 signiﬁcant 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 ﬁnd 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 ﬁgure 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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

hw_04 - CS 473 Fundamental Algorithms Spring 2012 Homework...

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

View Full Document
Ask a homework question - tutors are online