java - Big O notation (Complexity) -



java - Big O notation (Complexity) -

what big o of loop? -> understand loop going execute n times. task within of loop executes n times right? create o(n^2) or not combine them , simple o(n)? think o(n) because how many times loop executing clarification why or why not be? explanations helpful prepare midterm.

for(int = 0; < a.length;i++){ a[i] = b[i] }

think how many times code within loop executes. each a[i] = b[i] happens a.length times, phone call n. o(n).

java big-o complexity-theory

Comments

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -