Employeur impliqué
Write a code for finding a certain element in an unsorted array assuming element definitely exists. How can we improve the efficiency?
Utilisateur anonyme
O(n) ia always smaller than O(nlogn)+O(logn). hence linear search will always be efficient
i think the simplest way to solve is to scan it once, it will have O(n) complexity well any other answers?
it's O(n) to improve efficiency sort it first : O(nlgn) then every look-up becomes O(lgn)
Tenez-vous au courant des dernières opportunités et profitez de conseils d’initiés en suivant les entreprises de vos rêves.
Obtenez des recommandations et des mises à jour personnalisées en démarrant vos recherches.