首页 > 解决方案 > Big-O algorithm

问题描述

enter image description here

Can anyone tell me answer for this algorithm?

I Think the answer is O(nlogn) but i’m not confident with my answer

标签: algorithmbig-o

解决方案


它将是 n^2。因为循环给出了 n 的复杂度。和循环是嵌套的,所以它的 n*n=n^2。


推荐阅读