• Menu
  • Skip to right header navigation
  • Skip to main content
  • Skip to secondary navigation
  • Skip to primary sidebar

OnlineProgrammingBooks.com

Legally Free Computer Books

  • All Categories
  • All Books
  • All Categories
  • All Books
  • About Us
  • Privacy policy
  • Disclaimer
  • Subscribe
  • Contact
You are here: Home ▶ Programming ▶ Herong’s Tutorial Notes on Sorting

Herong’s Tutorial Notes on Sorting

March 24, 2006

This free book is an excellent tutorial book for beginners. It is a collection of notes and sample codes written by the author while he was learning sorting algorithms. Sorting makes it possible to search a particular data element in a collection quickly by applying the binary search technique.

Book Description

Everyone knows what is the binary search technique? We are using it every time when we look up a word in a dictionary.

How much time we can save by using the binary search technique? Let’s do a rough calculation. Assume that we have a sorted dictionary and an un-sorted dictionary with the same collection of words printed on about 1000 pages.

Looking up a word in the un-sorted dictionary, the best case is that you found the word on the first page; the worst case is that you looked through all 1000 the pages, and found the word on the last page. So roughly the average time you spend is checking 500 pages.

Looking up a word in the sorted dictionary, the best case is that you found the word on the center page, which is the first page you will be checking based on the binary search technique; the worst case is that you found the word on the final page after you have divided the dictionary 10 times. So roughly the average time you spend is checking 5 pages.

The answer is obvious. We are saving about 99% of our time by using the sorted dictionary!

Table of Contents

  • Introduction
  • Sorting API in Java
  • Insertion Sort
  • Selection Sort
  • Bubble Sort
  • Quicksort
  • Merge Sort
  • Heap Sort
  • Shell Sort

Download Free PDF / Read Online

Author(s): Dr. Herong Yang
Format(s): HTML
Link: Read online.

Similar Books:

  1. Sorting and Searching Algorithms: A Cookbook
  2. Smalltalk/V 286 Tutorial and Programming Handbook
  3. Programming from Specifications
  4. Tabu Search
  5. Particle Swarm Optimization
Previous Post: « Inside Smalltalk (Volume One)
Next Post: Grokking the GIMP: Advanced Techniques for Working with Digital Images »

Primary Sidebar

Get Latest Updates

  • Facebook
  • Pinterest
  • RSS
  • Twitter
  • YouTube
  • About Us
  • Privacy policy
  • Disclaimer
  • Subscribe
  • Contact

Copyright © 2006–2023 OnlineProgrammingBooks.com