daily pastebin goal
87%
SHARE
TWEET

Untitled

a guest Sep 12th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Changing from recursion to iteration
  2. void func(int a, int b, int c, int d) {
  3.     //something
  4.     //non-recursive
  5.     //here..
  6.  
  7.     for (i=0; i<data.length; i++) {
  8.         if (!data[i].x) {
  9.             data[i].x = 1;
  10.             if (a == data[i].value1)
  11.                 func(data[i].value2,b,c,d);
  12.             else if (a == data[i].value2)
  13.                 func(data[i].value1,b,c,d);
  14.  
  15.             data[i].x = 0;
  16.         }
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top