1. Learn
  2. /
  3. Courses
  4. /
  5. Optimizing Code in Java

Connected

Exercise

Comparing search algorithm performance

As a software developer at an e-commerce company, you're evaluating different search methods to improve product search functionality. Until now, the search mechanism the company was using was very slow, but you managed to remove that delay already. Your task now is to compare your new search method with the old one, to prove it is more efficient for your catalog search feature.

Instructions

100 XP
  • Find the target element using the new search method, linearSearch().
  • Then, find the target element using the old search method, linearSearchWithDelay().
  • Calculate the relative performance difference of the search methods.