Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Introduction to Java
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Related Services

Bookmark and Share
Lecture Comments (8)

1 answer

Last reply by: Professor Quayle
Thu Apr 9, 2015 12:21 AM

Post by Eponine Rosner on April 8, 2015

Quicksort is on the 2015 AP CS exam

1 answer

Last reply by: Professor Quayle
Thu Apr 9, 2015 12:02 AM

Post by Travis Valdez on April 3, 2015

Hello,
In our class we were asked to list out what comparisons to what values Merge Sort was comparing throughout the entire Merge Sort program (After we were given an array) For example, Merging[number] and [number] and we had to fill in the correct numbers for each step. It would be helpful to include in the Merge Sort tutorial an actual example of MergeSort code because in my opinion, it is the hardest sorting algorithim in the AP subset. The walk through you gave kind of only scratched the surface.

1 answer

Last reply by: Professor Quayle
Tue Apr 29, 2014 1:20 AM

Post by Jun Hur on April 28, 2014

Are we not required to know how to write these sort methods in actual Java codes?

Do we only need to know algorithms?

0 answers

Post by ABDURRAFI GORGUN on May 16, 2012

quick sort

0 answers

Post by ABDURRAFI GORGUN on May 16, 2012

would you mind to explain 1st row 51794682 and the next row is 14257968 i wonder how 4 and 2 change

Algorithms: Sorting

  • Sorting is putting items in a collection in order (either ascending or descending)
  • Can sort primitive types or objects of any class that implements the Comparable interface
  • Selection Sort is a simple but inefficient sorting algorithm
  • Insertion Sort is a simple but inefficient sorting algorithm
  • Merge Sort is a more efficient, recursive sorting algorithm
  • Quick Sort is a more efficient, recursive sorting algorithm (most efficient sort algorithm for large collections of data but not in the AP subset)

Algorithms: Sorting

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

  • Intro 0:00
  • Roadmap 0:08
  • Sorting 0:55
    • Definition of Sorting
    • Cant Sort Any of the Following
  • Selection Sort 3:49
    • Definition of Selection Sort
    • 'Search-and-Swap' Algorithm
  • Selection Sort Example 7:46
  • Insertion Sort 10:57
  • Insertion Sort Example 13:02
  • Merge Sort 15:14
    • Recursive Sorting Algorithm
  • Merge Sort Example 18:03
  • Quick Sort 20:34
    • Recursive Sorting Algorithm
  • Quick Sort Example 23:35
  • Summary 27:19