A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.

Slides:



Advertisements
Similar presentations
A simple example finding the maximum of a set S of n numbers.
Advertisements

Divide-and-Conquer The most-well known algorithm design strategy:
Divide and Conquer Strategy
DIVIDE AND CONQUER. 2 Algorithmic Paradigms Greedy. Build up a solution incrementally, myopically optimizing some local criterion. Divide-and-conquer.
Algorithm Design Paradigms
Copyright © 2007 Pearson Addison-Wesley. All rights reserved. Problem Reduction Dr. M. Sakalli Marmara Unv, Levitin ’ s notes.
Divide-and-Conquer Dr. Yingwu Zhu P65-74, p83-88, p93-96, p
1 Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
CS4413 Divide-and-Conquer
Lecture 10 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Chapter 4: Divide and Conquer Master Theorem, Mergesort, Quicksort, Binary Search, Binary Trees The Design and Analysis of Algorithms.
Theory of Algorithms: Divide and Conquer
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 6 Ack : Carola Wenk nad Dr. Thomas Ottmann tutorials.
DIVIDE AND CONQUER APPROACH. General Method Works on the approach of dividing a given problem into smaller sub problems (ideally of same size).  Divide.
Analysis of Algorithms CS 477/677 Sorting – Part B Instructor: George Bebis (Chapter 7)
Spring 2015 Lecture 5: QuickSort & Selection
Chapter 4 Divide-and-Conquer Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 4 Some of the sides are exported from different sources.
Lecture 8 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Algorithm Design Strategy Divide and Conquer. More examples of Divide and Conquer  Review of Divide & Conquer Concept  More examples  Finding closest.
CS 253: Algorithms Chapter 7 Mergesort Quicksort Credit: Dr. George Bebis.
Chapter 4 Divide-and-Conquer Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 4: Divide and Conquer The Design and Analysis of Algorithms.
5 - 1 § 5 The Divide-and-Conquer Strategy e.g. find the maximum of a set S of n numbers.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
Design and Analysis of Algorithms – Chapter 51 Divide and Conquer (I) Dr. Ying Lu RAIK 283: Data Structures & Algorithms.
Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
ALGORITHM ANALYSIS AND DESIGN INTRODUCTION TO ALGORITHMS CS 413 Divide and Conquer Algortihms: Binary search, merge sort.
Chapter 4 Divide-and-Conquer Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
MA/CSSE 473 Day 17 Divide-and-conquer Convex Hull Strassen's Algorithm: Matrix Multiplication.
Theory of Algorithms: Divide and Conquer James Gain and Edwin Blake {jgain | Department of Computer Science University of Cape Town.
Copyright © 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin “ Introduction to the Design & Analysis of Algorithms, ” 2 nd ed., Ch. 1 Chapter.
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Merge Sort. What Is Sorting? To arrange a collection of items in some specified order. Numerical order Lexicographical order Input: sequence of numbers.
Sorting. Pseudocode of Insertion Sort Insertion Sort To sort array A[0..n-1], sort A[0..n-2] recursively and then insert A[n-1] in its proper place among.
Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2.Solve smaller instances.
Divide and Conquer Andreas Klappenecker [based on slides by Prof. Welch]
Divide and Conquer Strategy
Sorting Fundamental Data Structures and Algorithms Aleks Nanevski February 17, 2004.
Young CS 331 D&A of Algo. Topic: Divide and Conquer1 Divide-and-Conquer General idea: Divide a problem into subprograms of the same kind; solve subprograms.
Lecture 6 Sorting II Divide-and-Conquer Algorithms.
MA/CSSE 473 Day 14 Strassen's Algorithm: Matrix Multiplication Decrease and Conquer DFS.
Subject Name: Design and Analysis of Algorithm Subject Code: 10CS43
Chapter 4 Divide-and-Conquer
Chapter 5 Divide & conquer
Divide-and-Conquer The most-well known algorithm design strategy:
Chapter 4 Divide-and-Conquer
CSCE350 Algorithms and Data Structure
Divide-and-Conquer The most-well known algorithm design strategy:
Chapter 4: Divide and Conquer
Divide-and-Conquer The most-well known algorithm design strategy:
Unit-2 Divide and Conquer
Topic: Divide and Conquer
Decrease-and-Conquer
Divide-and-Conquer.
Divide-and-Conquer The most-well known algorithm design strategy:
Chapter 4 Divide-and-Conquer
Divide and Conquer Merge sort and quick sort Binary search
Chapter 4.
Divide-and-Conquer The most-well known algorithm design strategy:
Algorithms Dr. Youn-Hee Han April-May 2013
CSC 380: Design and Analysis of Algorithms
CSC 380: Design and Analysis of Algorithms
Introduction to Algorithms
CSC 380: Design and Analysis of Algorithms
CSC 380: Design and Analysis of Algorithms
Divide and Conquer Merge sort and quick sort Binary search
Presentation transcript:

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 1 Divide-and-Conquer The most-well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances recursively 3. Obtain solution to original (larger) instance by combining these solutions Distinction between divide and conquer and decrease and conquer is somewhat vague. Dec/con typically does not solve both subproblems.

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 2 Divide-and-Conquer Technique (cont.) subproblem 2 of size n/2 subproblem 1 of size n/2 a solution to subproblem 1 a solution to the original problem a solution to subproblem 2 a problem of size n

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 3 Divide-and-Conquer Examples b Sorting: mergesort and quicksort b Binary tree traversals b Multiplication of large integers b Matrix multiplication: Strassen’s algorithm b Closest-pair and convex-hull algorithms b Binary search: decrease-by-half (or degenerate divide&conq.)

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 4 General Divide-and-Conquer Recurrence T(n) = aT(n/b) + f (n) where f(n)   (n d ), d  0 Master Theorem: If a < b d, T(n)   (n d ) If a = b d, T(n)   (n d log n) If a = b d, T(n)   (n d log n) If a > b d, T(n)   ( n log b a ) If a > b d, T(n)   ( n log b a ) Note: The same results hold with O instead of . Examples: T(n) = 4T(n/2) + n  T(n)  ? T(n) = 4T(n/2) + n 2  T(n)  ? T(n) = 4T(n/2) + n 2  T(n)  ? T(n) = 4T(n/2) + n 3  T(n)  ? T(n) = 4T(n/2) + n 3  T(n)  ?

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 5 Mergesort Example

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 6 Mergesort b Split array A[0..n-1] in two about equal halves and make copies of each half in arrays B and C b Sort arrays B and C recursively b Merge sorted arrays B and C into array A as follows: Repeat the following until no elements remain in one of the arrays:Repeat the following until no elements remain in one of the arrays: –compare the first elements in the remaining unprocessed portions of the arrays –copy the smaller of the two into A, while incrementing the index indicating the unprocessed portion of that array Once all elements in one of the arrays are processed, copy the remaining unprocessed elements from the other array into A.Once all elements in one of the arrays are processed, copy the remaining unprocessed elements from the other array into A.

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 7 Pseudocode of Mergesort Thinking about recursive programs: Assume recursive calls work and ask does the whole program then work?

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 8 Pseudocode of Merge

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 9 Analysis of Mergesort b Number of key comparisons – recurrence: C(n) = … For merge step: C’(n) = …

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 10 Analysis of Mergesort b Number of key comparisons – recurrence: C(n) = 2C(n/2) + C’(n) = 2C(n/2) + n-1 For merge step – worst case: C’(n) = n-1 b How to solve? b Number of calls? Number of active calls?

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 11 Analysis of Mergesort b All cases have same efficiency: Θ(n log n) b Number of comparisons in the worst case is close to theoretical minimum for comparison-based sorting:  log 2 n!  ≈ n log 2 n n  log 2 n!  ≈ n log 2 n n b Space requirement: Book’s algorithm?Book’s algorithm? Can be done Θ(n) : Don’t copy in sort; just specify bounds, copy into extra array on merge, then copy backCan be done Θ(n) : Don’t copy in sort; just specify bounds, copy into extra array on merge, then copy back Can be implemented in place. How …Can be implemented in place. How … b Can be implemented without recursion (bottom-up)

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 12 Quicksort b Select a pivot (partitioning element) – here, the first element b Rearrange the list so that all the elements in the first s positions are smaller than or equal to the pivot and all the elements in the remaining n-s positions are larger than or equal to the pivot (see next slide for an algorithm) b Exchange the pivot with the last element in the first (i.e.,  ) subarray — the pivot is now in its final position b Sort the two subarrays recursively p A[i]  p A[i]  p

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 13 Hoare’s (Two-way) Partition Algorithm

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 14 Quicksort Example

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 15 Analysis of Quicksort b Best case: split in the middle — Θ(n log n) b Worst case: sorted array! — Θ(n 2 ) b Average case: random arrays — Θ(n log n) b Improvements: better pivot selection: median of three partitioningbetter pivot selection: median of three partitioning switch to insertion sort on small sub-arraysswitch to insertion sort on small sub-arrays elimination of recursion – How?elimination of recursion – How? These combine to 20-25% improvement b Considered the method of choice for internal sorting of large files (n ≥ 10000)

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 16 Binary Tree Algorithms Binary tree is a divide-and-conquer ready structure! Ex. 1: Classic traversals (preorder, inorder, postorder) Algorithm Inorder(T) a a a a b c b c b c b c d e d e d e d e Efficiency: Θ(n)

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 17 Binary Tree Algorithms Binary tree is a divide-and-conquer ready structure! Ex. 1: Classic traversals (preorder, inorder, postorder) Algorithm Inorder(T) if T   a a Inorder(T left ) b c b c Inorder(T left ) b c b c print(root of T) d e d e print(root of T) d e d e Inorder(T right ) Inorder(T right ) Efficiency: Θ(n)

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 18 Binary Tree Algorithms (cont.) Ex. 2: Computing the height of a binary tree h(T) = ?? Efficiency: Θ(n)

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 19 Binary Tree Algorithms (cont.) Ex. 2: Computing the height of a binary tree h(T) = max{h(T L ), h(T R )} + 1 if T  and h(  ) = -1 h(T) = max{h(T L ), h(T R )} + 1 if T   and h(  ) = -1 Efficiency: Θ(n)

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 20 Multiplication of Large Integers Consider the problem of multiplying two (large) n-digit integers represented by arrays of their digits such as: A = B = The grade-school algorithm: a 1 a 2 … a n b 1 b 2 … b n (d 10 ) d 11 d 12 … d 1n (d 20 ) d 21 d 22 … d 2n (d 20 ) d 21 d 22 … d 2n … … … … … … … … … … … … … … (d n0 ) d n1 d n2 … d nn Efficiency: n 2 one-digit multiplications Efficiency: n 2 one-digit multiplications

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 21 First Divide-and-Conquer Algorithm A small example: A  B where A = 2135 and B = 4014 A = (21· ), B = (40 · ) So, A  B = (21 · )  (40 · ) = 21  40 · (21   40) ·  14 = 21  40 · (21   40) ·  14 In general, if A = A 1 A 2 and B = B 1 B 2 (where A and B are n-digit, A 1, A 2, B 1, B 2 are n/2-digit numbers), A  B = A 1  B 1 ·10 n + (A 1  B 2 + A 2  B 1 ) ·10 n/2 + A 2  B 2 Recurrence for the number of one-digit multiplications M(n): M(n) = 4M(n/2), M(1) = 1 Solution: M(n) = n 2 M(n) = 4M(n/2), M(1) = 1 Solution: M(n) = n 2

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 22 Second Divide-and-Conquer Algorithm A  B = A 1  B 1 ·10 n + (A 1  B 2 + A 2  B 1 ) ·10 n/2 + A 2  B 2 The idea is to decrease the number of multiplications from 4 to 3: (A 1 + A 2 )  (B 1 + B 2 ) = A 1  B 1 + (A 1  B 2 + A 2  B 1 ) + A 2  B 2, I.e., (A 1  B 2 + A 2  B 1 ) = (A 1 + A 2 )  (B 1 + B 2 ) - A 1  B 1 - A 2  B 2, which requires only 3 multiplications at the expense of (4-1=3) extra additions and subtractions (2 adds and 2 subs – 1 add) (A 1 + A 2 )  (B 1 + B 2 ) = A 1  B 1 + (A 1  B 2 + A 2  B 1 ) + A 2  B 2, I.e., (A 1  B 2 + A 2  B 1 ) = (A 1 + A 2 )  (B 1 + B 2 ) - A 1  B 1 - A 2  B 2, which requires only 3 multiplications at the expense of (4-1=3) extra additions and subtractions (2 adds and 2 subs – 1 add) Recurrence for the number of multiplications M(n): M(n) = 3M(n/2), M(1) = 1 Solution: M(n) = 3 log 2 n = n log 2 3 ≈ n 1.585

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 23 Example of Large-Integer Multiplication 2135  4014

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 24 Strassen’s Matrix Multiplication Strassen observed [1969] that the product of two matrices can be computed as follows: Strassen observed [1969] that the product of two matrices can be computed as follows: C 00 C 01 A 00 A 01 B 00 B 01 = * = * C 10 C 11 A 10 A 11 B 10 B 11 M 1 + M 4 - M 5 + M 7 M 3 + M 5 M 1 + M 4 - M 5 + M 7 M 3 + M 5 = M 2 + M 4 M 1 + M 3 - M 2 + M 6 M 2 + M 4 M 1 + M 3 - M 2 + M 6 b Example: M 2 + M 4 = (A 10 + A 11 )  B 00 + A 11  (B 10 - B 00 ) b = A 10 B 00 + A 11 B 10

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 25 Formulas for Strassen’s Algorithm M 1 = (A 00 + A 11 )  (B 00 + B 11 ) M 2 = (A 10 + A 11 )  B 00 M 3 = A 00  (B 01 - B 11 ) M 4 = A 11  (B 10 - B 00 ) M 5 = (A 00 + A 01 )  B 11 M 6 = (A 10 - A 00 )  (B 00 + B 01 ) M 7 = (A 01 - A 11 )  (B 10 + B 11 )

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 26 Analysis of Strassen’s Algorithm If n is not a power of 2, matrices can be padded with zeros. Number of multiplications: M(n) = 7M(n/2), M(1) = 1 M(n) = 7M(n/2), M(1) = 1 Solution: M(n) = 7 log 2 n = n log 2 7 ≈ n vs. n 3 of brute-force alg. Algorithms with better asymptotic efficiency are known but they are even more complex.

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 27 Closest-Pair Problem by Divide-and-Conquer Step 1 Divide the points given into two subsets P l and P r by a vertical line x = m so that half the points lie to the left or on the line and half the points lie to the right or on the line.

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 28 Closest Pair by Divide-and-Conquer (cont.) Step 2 Find recursively the closest pairs for the left and right subsets. Step 3 Set d = min{d l, d r } We can limit our attention to the points in the symmetric vertical strip S of width 2d as possible closest pair. (The points are stored and processed in increasing order of their y coordinates.) We can limit our attention to the points in the symmetric vertical strip S of width 2d as possible closest pair. (The points are stored and processed in increasing order of their y coordinates.) Step 4 Scan the points in the vertical strip S from the lowest up. For every point p(x,y) in the strip, inspect points in in the strip that may be closer to p than d. There can be no more than 5 such points following p on the strip list!

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 29 Closest Pair by Divide-and-Conquer (cont.) How many points could be in each strip? n/2 Brute force would look at all n/2 x n/2 pairs Brute force would look at all n/2 x n/2 pairs Why can we restrict ourselves to calculating the distance from each point to the next 5 points from each point to the next 5 points Because only the next 5 points could be within distance d of the current point. Why? Consider a square of size d: No two points in it can be closer than d. How many points can it contain. No more than 4 (since 5 won’t fit). Thus a rectangle of size dx2d can only contain 8 points (or 6 if duplicates are not allowed). So from a point, only check the next 7 (or 5) points.

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 30 Efficiency of the Closest-Pair Algorithm Running time of the algorithm is described by T(n) = 2T(n/2) + M(n), where M(n)  O(n) T(n) = 2T(n/2) + M(n), where M(n)  O(n) By the Master Theorem (with a = 2, b = 2, d = 1) T(n)  O(n log n) T(n)  O(n log n)

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 31 Quickhull Algorithm Convex hull: smallest convex set that includes given points b Assume points are sorted by x-coordinate values b Identify extreme points P 1 and P 2 (leftmost and rightmost) b Compute upper hull recursively: find point P max that is farthest away from line P 1 P 2find point P max that is farthest away from line P 1 P 2 compute the upper hull of the points to the left of line P 1 P maxcompute the upper hull of the points to the left of line P 1 P max compute the upper hull of the points to the left of line P max P 2compute the upper hull of the points to the left of line P max P 2 b Compute lower hull in a similar manner P1P1 P2P2 P max

A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 5 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. 32 Efficiency of Quickhull Algorithm b Finding point farthest away from line P 1 P 2 can be done in linear time b Time efficiency: worst case: Θ(n 2 ) (as quicksort)worst case: Θ(n 2 ) (as quicksort) average case: Θ(n) (under reasonable assumptions about distribution of points given)average case: Θ(n) (under reasonable assumptions about distribution of points given) b If points are not initially sorted by x-coordinate value, this can be accomplished in O(n log n) time b Several O(n log n) algorithms for convex hull are known