
Quantum Computing in Practice with Qiskit® and IBM Quantum Experience®
By :

Before we hit the Grover algorithm, let's just take a quick peek at a standard, classical linear search algorithm. For a classical algorithm that searches an unordered database, the average number of times you have to look for a given entry is of the order of where N is the number of items in the database. For example, if your unordered database has four items, you will generally have to look an average of two times to find your item.
The sample code for this recipe can be found here: https://github.com/PacktPublishing/Quantum-Computing-in-Practice-with-Qiskit-and-IBM-Quantum-Experience/blob/master/Chapter09/ch9_r2_classic_search.py.
Let's search for a specific two-bit entry in a small database with four items:
Searching in a scrambled database with...