complexity of algorithms

Posted by davit-datuashvili on Stack Overflow See other posts from Stack Overflow or by davit-datuashvili
Published on 2010-05-26T05:45:00Z Indexed on 2010/05/26 5:51 UTC
Read the original article Hit count: 135

Filed under:

i have question what is complexity of this algorithm

public class smax{

public static void main(String[]args){

int b[]=new int[11];

int a[]=new int[]{4,9,2,6,8,7,5};

for (int i=0;i

int m=0; while (m

int k=a[0]; for (int i=0;i k && b[a[i]]!=1){ b[a[i]]=1; } } m++; }

for (int i=0;i

for (int j=0;j

//result=2 4 5 6 7 8 9

} } ?

© Stack Overflow or respective owner

Related posts about algorithm