How Search Algorithms Work