O'Reilly logo

Advanced Topics in C: Core Concepts in Data Structures 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 1

image

Sorting, Searching, and Merging

In this chapter, we will explain the following:

  • How to sort a list of items using selection and insertion sort
  • How to add a new item to a sorted list so that the list remains sorted
  • How to sort an array of strings
  • How to sort related (parallel) arrays
  • How to search a sorted list using binary search
  • How to search an array of strings
  • How to write a program to do a frequency count of words in a passage
  • How to merge two sorted lists to create one sorted list

1.1 Sorting an Array: Selection Sort

Sorting is the process by which a set of values are arranged in ascending or descending order. There are many ...

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