Question: is o(n) better than o(logn)?
Answer: O(log n) is better. O(logn) means that the algorithm's maximum running time is proportional to the logarithm of the input size. O(n) means that the algorithm's maximum running time is proportional to the input size. ... therefore, O(logn) is tighter than O(n) and is also better in terms of algorithms analysis.