Quote Originally Posted by Snape View Post
So when the array length is 10 average=(near)length*2 but when array length is 100 average=(near)length*2,3

Should it help me or this information is worthless?
Your test shows that the algrithm has O(N^2) complexity indeed.

When you make the array 10 times bigger the test takes 10^2 = 100 times longer.

This trend should stick. For example if you make the array 25 times larger (array length = 250) the test will take 25^2 = 625 times longer.

Note that complexity measures are not exact, they show the overall trend. But it's a valuable hint in practice as to how your program will scale when the the input load is increased (like for example a much bigger array is used).