Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Changing from recursion to iteration
- void func(int a, int b, int c, int d) {
- //something
- //non-recursive
- //here..
- for (i=0; i<data.length; i++) {
- if (!data[i].x) {
- data[i].x = 1;
- if (a == data[i].value1)
- func(data[i].value2,b,c,d);
- else if (a == data[i].value2)
- func(data[i].value1,b,c,d);
- data[i].x = 0;
- }
- }
- }
Add Comment
Please, Sign In to add comment