Exer7 - CMPT 307 — Data Structures and Algorithms Exercises on Divide and Conquer Due Thursday November 19th(at the beginning of the class

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: CMPT 307 — Data Structures and Algorithms Exercises on Divide and Conquer. Due: Thursday, November 19th (at the beginning of the class) Reminder: the work you submit must be your own. Any collaboration and consulting outside resources must be explicitly mentioned on your submission. 1. Recall the problem of finding the number of inversions. As in the class, we are given a sequence of n numbers a 1 ,...,a n , which we assume are all distinct, and we define an inversion to be a pair i < j such that a i > a j . We motivated the problem of counting inversions as a good measure of how different two orderings are. However, one might feel that this measure is too sensitive. Let us call a pair a significant inversion if i < j and a i > 2 a j . Give an O ( n log n ) algorithm to count the number of significant inversions between two orderings. 2. Suppose you are consulting for a bank that is concerned about fraud detection, and they come to you with the following problem. They have a collection ofcome to you with the following problem....
View Full Document

This note was uploaded on 11/19/2009 for the course CS CMPT 307 taught by Professor A.bulatov during the Fall '09 term at Simon Fraser.

Ask a homework question - tutors are online