Searching

Introduction

Searching is the process of trying to find something by looking or otherwise seeking carefully and thoroughly. Searching is the act of finding an item within a list of items. Different search methods are used depending on the sequence of the data. More efficient techniques are used if the data is sorted.

No Order

If the data is unordered, then all items are checked in order to find the required item. An array of elements is defined, with the elements being in no particular order. All elements are checked until a matching element is found.

Order

If the data is ordered, then only items with a key less than the required item, are checked in order to find the item. An array of elements is defined, with the elements being sorted. All elements are checked until a matching element is found or until an element greater than the element being sought is found.

Dialog

Input
Output

Please note that the case of the search item is important.