O'Reilly logo

Introducing Data Structures with Java by David Cousins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8

Sorting Arrays—Selection, Bubble, Insertion, Merge and Quick Sorts

Sorting Arrays Sorting Arrays

Contents

  • A fundamental operation—sorting array contents to create an ordered list
  • Five sorting algorithms—bubble, selection, insertion, merge and quick sorts
  • Recursion
  • Sorting algorithm efficiency
8.1 INTRODUCTION

In Chapter 6, we saw that an ordered array can use the efficient binary search method. If the data are initially unordered, how can they be sorted into order? This chapter addresses sorting operations, examines in detail five algorithms (from many that exist) and compares their efficiency with the Big-O expression for each.

8.2 GENERAL PRINCIPLES ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required