Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Give the Big O notation for the following function. public static void notationF

ID: 3535724 • Letter: G

Question

Give the Big O notation for the following function.



public static void notationFunction(int arr[], int length)
{
System.out.println(“ This function is sweetâ€);
for(int i = 0;i<length;i++)
}
System.out.println(“Arr[“ + i + “] = “ + arr[i]);
}
System.out.println(“Is this function order N?â€);
System.out.println(“maybe...â€);
for (int i = 0;i<100000;i++)
{
System.out.println(“Arr[“ + 0 + “] = †+ arr[0]);
}
for(int i = 0;i<length;i++)
{
for(int j = 0;j<length;j++)
{
System.out.println(“stuffâ€);
}
}
int temp;
for ( int j = 0; j < length; j++ )
for(int y=0; y < length; y++)
{
for ( int k =0; k < length-1-y; k++ )
if(arr[k]>arr[k+1])
{
temp = arr[k+1];
arr[k+1] = arr[k];
arr[k] = temp;
}

}
for(int i = 0;i<length;i++)
{
System.out.println(“Arr[“ + i + “] = “ + arr[i]);
}
}







Explanation / Answer

www.codeproject.com/Articles/37990/Big-O-Algorithm

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote