O'Reilly logo

Learn to Program with C by Noel Kalicharan

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

CHAPTER 9

image

Searching, Sorting, and Merging

In this chapter, we will explain the following:

  • How to search a list using sequential search
  • How to sort a list using selection sort
  • How to sort a list using insertion sort
  • How to sort a list of strings
  • How to sort parallel arrays
  • How to search a sorted list using binary search
  • How to merge two sorted lists

9.1 Sequential Search

In many cases, an array is used for storing a list of information. Having stored the information, it may be required to find a given item in the list. For example, an array may be used to store a list of the names of 50 people. It may then be required to find the position in ...

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