big o - Can an algorithm have a runtime of O(2n)? -


this question has answer here:

if algorithm iterates on list of numbers 2 times before returning answer runtime o(2n) or o(n)? runtime of algorithm lack coefficient?

it may still slower implementation doesn't iterate twice, still o(n), time complexity scales based on size of n.


Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -