java - JUnit Test error -


i trying run junit test program, getting error message

*incompatible types required: int[]; found: int * 

here code shows error

myqsarray = qs.quicksort(sortedarray2,0, sortedarray2.length - 1); 

and here call quicksort method

public static int quicksort( int a[], int p, int r){     int q;      if (p<r)     {          q = partition(a,p,r);          quicksort(a, p, q-1);          quicksort(a,q+1,r);     }     return qs1.quicksort(a, p, r); } 

help please, in advance

i see couple of problems code:

the method declared return int value try assign int int[]. causes actual compiletime error. change method signature

public static int[] quicksort( int a[], int p, int r) 

for quick fix.

then, recursive function quicksort misses exit criteria. run indefinitely (or @ least until virtual machine gives , throws stackoverflowexception after couple of milliseconds). need add criteria check, if array sorted , return sorted array (see "new" method signature!).


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -