Home
[This page is auto-generated; please prefer to read the article’s PDF Form.]
[Prev] [Up] [Next] Fike’s Algorithm
void fike_nonrecur()
{
int I[N-1], s;
for(s = 0; s < N-1; s++)
I[s] = 0;
print();
s = N-2;
while(s >= 0)
{
/* Cleanup Block */
if(I[s] > 0)
SWAP(s, s+I[s]);
if(I[s] < N-s-1)
{
I[s]++;
/* Setup Block */
SWAP(s, s+I[s]);
print();
s = N-2;
}
else
{
I[s] = 0;
s = s-1;
}
}
}
[Prev] [Up] [Next]
Copyright © 2021 Nitin Verma. All rights reserved.