counting inversions i

6
Divide and Conquer Counting Inversion s I Design and Analysis of Algorithms I

Upload: denali

Post on 05-Jan-2016

47 views

Category:

Documents


0 download

DESCRIPTION

Divid e and Conquer. Counting Inversions I. Design and Analysis of Algorithms I. The Problem. Examples and Motivation. What is the largest-possible number of inversions that a 6-element array can have?. 15. 21. High-Level Approach. High-Level Algorithm. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Counting Inversions I

Divide and ConquerCounting Inversions I

Design and Analysis of Algorithms I

Page 2: Counting Inversions I

Tim Roughgarden

The Problem

Page 3: Counting Inversions I

Tim Roughgarden

Examples and Motivation

Page 4: Counting Inversions I

15

21

36

64

What is the largest-possible number of inversions that a 6-element array can have?

Page 5: Counting Inversions I

Tim Roughgarden

High-Level Approach

Page 6: Counting Inversions I

Tim Roughgarden

High-Level Algorithm