Slide 1
Objectives
Objectives (cont’d.)
Objectives (cont’d.)
Introduction
Searching and Sorting Algorithms
Search Algorithms
Sequential Search
Sequential Search Analysis
Sequential Search Analysis (cont’d.)
Binary Search
Binary Search (cont’d.)
Binary Search (cont’d.)
Performance of Binary Search
Binary Search Algorithm and the class orderedArrayListType
Asymptotic Notation: Big-O Notation
Asymptotic Notation: Big-O Notation (cont’d.)
Asymptotic Notation: Big-O Notation (cont’d.)
Asymptotic Notation: Big-O Notation (cont’d.)
Asymptotic Notation: Big-O Notation (cont’d.)
Asymptotic Notation: Big-O Notation (cont’d.)
Asymptotic Notation: Big-O Notation (cont’d.)
Asymptotic Notation: Big-O Notation (cont’d.)
Lower Bound on Comparison-Based Search Algorithms
Sorting Algorithms
Sorting a List: Bubble Sort
Sorting a List: Bubble Sort (cont’d.)
Sorting a List: Bubble Sort (cont’d.)
Analysis: Bubble Sort
Bubble Sort Algorithm and the class unorderedArrayListType
Selection Sort: Array-Based Lists
Analysis: Selection Sort
Insertion Sort: Array-Based Lists
Insertion Sort: Array-Based Lists (cont’d.)
Insertion Sort: Array-Based Lists (cont’d.)
Insertion Sort: Array-Based Lists (cont’d.)
Insertion Sort: Array-Based Lists (cont’d.)
Insertion Sort: Array-Based Lists (cont’d.)
Analysis: Insertion Sort
Analysis: Insertion Sort (cont’d.)
Lower Bound on Comparison-Based Sort Algorithms
Lower Bound on Comparison-Based Sort Algorithms (cont’d.)
Lower Bound on Comparison-Based Sort Algorithms (cont’d.)
Lower Bound on Comparison-Based Sort Algorithms (cont’d.)
Lower Bound on Comparison-Based Sort Algorithms (cont’d.)
Quick Sort: Array-Based Lists
Quick Sort: Array-Based Lists (cont’d.)
Quick Sort: Array-Based Lists (cont’d.)
Quick Sort: Array-Based Lists (cont’d.)
Quick Sort: Array-Based Lists (cont’d.)
Quick Sort: Array-Based Lists (cont’d.)
Quick Sort: Array-Based Lists (cont’d.)
Quick Sort: Array-Based Lists (cont’d.)
Quick Sort: Array-Based Lists (cont’d.)
Analysis: Quick Sort
Merge Sort: Linked List-Based Lists
Merge Sort: Linked List-Based Lists (cont’d.)
Merge Sort: Linked List-Based Lists (cont’d.)
Divide
Divide (cont’d.)
Merge
Merge (cont’d.)
Merge (cont’d.)
Analysis: Merge Sort
Analysis: Merge Sort (cont’d.)
Analysis: Merge Sort (cont’d.)
Analysis: Merge Sort (cont’d.)
Summary
Summary (cont’d.)
Summary (cont’d.)