1. Trang chủ
  2. » Giáo án - Bài giảng

16 1 19 master method tủ tài liệu training pdf

12 74 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 12
Dung lượng 1,42 MB

Nội dung

Master Method The Precise Statement Design and Analysis of Algorithms I... THE MASTER METHODNextcore AI -Gopal Shangari Cool Feature : a “black box” for solving recurrences.. AssumpFon

Trang 1

Master Method The Precise

Statement

Design and Analysis

of Algorithms I

Trang 2

THE MASTER METHOD

Nextcore AI -Gopal Shangari

Cool Feature : a “black box” for solving

recurrences.

AssumpFon : all subproblems have

equal size.

Trang 3

RECURRENCE FORMAT

Nextcore AI -Gopal Shangari

where

a = number of recursive calls (>= 1ti

b = input size shrinkage factor ( >

1ti

d = exponent in running Fme of “combine step” (>=0ti [a,b,d independent of n ]

1 Base Case : T(nti <= a constant for all sufficiently small n

2 For all larger n :

Trang 4

The Master Method

Nextcore AI -Gopal Shangari

Trang 5

Master Method

Examples

Design and Analysis

of Algorithms I

Trang 6

The Master Method

Trang 7

EXAMPLE #1

Nextcore AI -Gopal Shangari

Merge Sort

a = 2

b = 2

d = 1

a

Trang 8

1, 2, 0 [Case 1]

Trang 9

Example #3

Integer MulKplicaKon Algorithm # 1

a = 4

b = 2

d = 1

Same as gradeNschool algorithm

Trang 10

BeP er than the gradeN school

algorithm!!!

Trang 11

Example #5

Strassen’s Matrix MulKplicaKon Algorithm

a = 7

b = 2

d = 2

=> beats the nạve iteraKve algorithm !

Trang 12

Example #6

FicKKous Recurrence

 a = 2

 b = 2

 d = 2

Ngày đăng: 17/11/2019, 07:35

TỪ KHÓA LIÊN QUAN

w