Skip to Main Content
Learn to Program with C
book

Learn to Program with C

by Noel Kalicharan
December 2015
Beginner content levelBeginner
336 pages
7h 4m
English
Apress
Content preview from Learn to Program with C

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Sudoku Programming with C

Sudoku Programming with C

Giulio Zambon
Learning C for Arduino

Learning C for Arduino

Syed Omar Faruk Towaha

Publisher Resources

ISBN: 9781484213711Purchase book