Johnson
BAN USER
Comments (5)
Reputation -5
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Assuming array elements will traversed from Left to Right...like a..b.c..d..
and Minimum size of array should be 4...
so
#define LHS (A,B) A+B
#define RHS (C,D) C+B
....in a loop..
for ( int i=0; i <n-4;++i)
for ( int j=i+1;j<n-3;++j)
for ( int k=j+1;k<n-2;++k)
for (int l=k+1;k<n-1;++l)
{
if ( LHS(a[i],a[j]) == RHS(a[k][a[l])
cout<<i<<j<<k<<l<<"Are the indexes" <<endl;
i=j=k=l=n;
}
....
in case if the array element traverse any order..need to execute one more function in reverse order..
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Also it should have header node...for n numbers..
- Johnson October 20, 2014