Computer Science 252
Problem Solving with Java
Spring 2015, The College of Saint Rose
Lecture 25: Searching and Sorting
Date: Thursday, April 23, 2015
Agenda
- Announcements
- A bit more of a look at the hangman example
- "Evil" Hangman
- Searching
- linear search
- binary search
- A bit on sorting
- selection sort
- insertion sort
- merge sort
Lecture 25 Assignment
Due at the start of class, Tuesday, April 28.
- BDM Exercise 20.1.4, p. 581. (2 points)
- BDM Exercise 20.6.3, p. 599. (3 points)
- Apply the selection sort algorithm to the array below. Show all
steps. (5 points)
9 4 7 8 2 1 3
- Apply the insertion sort algorithm to the array from the
previous problem. Show all steps. (5 points)
Terminology
- searching
- binary search
- divide and conquer
- sorting
- selection sort
- insertion sort
- merge sort
Examples
Links