I am trying to translate a little java code, but have been unsuccessful with the snippet below. Any help would be appreciated.
Code:
' for(;;) ' { ' while(a[++i]<v); ' while(a[--j]>v); ' if (j<i) break; ' swap (a,i,j); ' } 'here's the swap function, but I'm almost sure that's not the problem because 'my translation works fine in another program. ' private void swap(int a[], int i, int j) ' { ' int T; ' T = a[i]; ' a[i] = a[j]; ' a[j] = T; ' } 'below is what I imagined it might be, but it is not working. INCR i DECR j WHILE a(i) < v WHILE a(j) > v IF j < i THEN EXIT FUNCTION SWAP a(j), a(i) DECR j WEND INCR i WEND
Comment