Pregunta de entrevista de Amazon

Optimize some Algorithm

Respuesta de la entrevista

Anónimo

26 feb 2011

Firstly, you have understand algorithm complexity notations and how to come up with them. Study "Big Oh notation," "Theta Notation," etc... After you have been given an algorithm to optimize, first determine if you can optimize any further without resorting to machine code optimization techniques. For instance if you are given an algorithm whose Best and Worst case scenario is n log n....good luck. However, if you are given an algorithm that has O(n squared) complexity...you're in business.