Expert
Algorithmic Optimization
Refactor inefficient code to optimize for time and space complexity.
📝 প্রম্পট বিষয়বস্তু
Review the following unoptimized pseudocode for a search function. Identify the time complexity using Big O notation and rewrite the algorithm to improve efficiency to O(log n). Additionally, discuss the trade-offs regarding memory usage and readability introduced by your optimization.