4: Searching and Sorting Algorithm

Data Structure and Algorithms · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-SA, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    4: Searching and Sorting Algorithm
    Unit Objectives

    Upon completion of this unit you should be able to:

    • describe the process of searching and sorting
    • design algorithms for searching and sorting
    • implement algorithms for searching and sorting

    Unit Introduction

    In this unit, you will learn some common processes that arise in computing; these are searching and sorting. Some common processes are those that involve finding a particular item in a given list of items, called searching. Another involves ordering items in a particular way of some given data, called sorting. The two represent a common application in computers where data has to be searched and retrieved. An example of an everyday application of this is in a telephone directory. It stores information such as the names, addresses and phone numbers of its customers. As the amount of information to be stored and accessed becomes very large, the computer comes in handy to assist in this task. To access the stored data, searching and sorting are carried out.

    Key Terms
    • Searching: the algorithmic finding of a particular item in a collection of given items
    • Sorting: the ordering of items in a given list

    Learning Activities

    • 4.1: Activity 1 - Searching Algorithm
      This activity involves studying the searching process and how to write algorithms that can find a particular given item from a list of given items. The activity of searching will dedicate itself to providing the answer of a presence or no presence of the searched item. The section will dedicate itself to introducing the sequential and binary types of search.
    • 4.2: Activity 2 - Sorting Algorithm
      This activity involves studying the sorting process and how to write algorithms that can order particular items in a list to be in given order. The activity of sorting ensures items in a given list are arranged in a desired order, say ascending or descending. The section involves studying insertion sort, shell sort, and quicksort algorithms.
    • 4.3: Unit Summary
      This unit discussed the searching and sorting algorithms together with their examples. Searching which is about finding a particular item in a given list of items, and Sorting on the other hand which is the ordering in a particular way of some given data, were explained. For the searching, the sequential and binary searches were discussed. While for the sorting algorithm, insertion sort, shell sort and quicksort were discussed.


    This page titled 4: Searching and Sorting Algorithm was last modified on Tue, 12 Dec 2023 01:31:17 GMT and is shared under a CC BY-SA license and was authored, remixed, and/or curated by Harrison Njoroge (African Virtual University) .