Normally for simple algos you can do it just by looking at the description of the algo. E.g. if there are two nested loops with indices dependent on N then it's almost certainly going to be O(N^2). For more complex algorithms you may have to do some basic ysis and algebra, but it's not hard.
No comments:
Post a Comment