Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

what is the time complexity of fun()? int fun(int n) { int count = 0; for (int i = 0; i < n; i++) for (int j = i; j > 0; j--) count = count + 1; return count; }

big O(n^2)
 
PREVIOUS NEXT
Tagged: #time #complexity #int #int #count #count #count #return
ADD COMMENT
Topic
Name
5+7 =