## louis.arokiaraj

BAN USER
Comments (2)

Followers (3)

Reputation 30

Page:

1

Comment hidden because of low score. Click to expand.

Comment hidden because of low score. Click to expand.

0

of 0 vote

its catalan number .. for given key n , the number of different binary search trees that could be found will be equal to ((2n)!/(n!*(n+1)!))..

- louis.arokiaraj October 21, 2013Page:

1

Rep**ryandchinkle**, Android Engineer at ABC TECH SUPPORTI was born in Northridge USA, I like photography, I have wide photos collection of wildlife. I have many religious ...

Rep**jesusitahyer**, Data Engineer at ASAPInfosystemsPvtLtdHello Everyone, I am Jesusita and I am passionate about writing the stories about powerful mantra to get what you ...

Rep**NatalieLutz**, Applications Developer at Absolute Softech LtdPitch trending story topics and continually look for ways to push breaking and/or viral stories forward with new angles ...

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window

#include<stdio.h>

- louis.arokiaraj December 10, 2013int main()

{

int i,j,a[100],temp;

static int n=0,sum=0,sum1=0,count=0,count1=0;

printf("\nEnter the number of terms:");

scanf("%d",&n);

printf("\nEnter the %d numbers:",n);

for(i=0;i<n;i++)

{

scanf("%d",&a[i]);

}

for(i=0;i<n;i++)

{

sum=sum+a[i];

}

printf("\n%d",sum);

if(sum==0)

{

printf("\nThe sum is zero already");

}

if(sum%2==0)

{

for(i=0;i<n;i++)

{

for(j=i;j<n;j++)

{

if(a[i]>a[j])

{

temp=a[i];

a[i]=a[j];

a[j]=temp;

}

}

}

for(i=0;i<(n/2);i=i+2)

count=count+(a[i]+a[n-i-1]);

for(i=1;i<(n/2);i=i+2)

count1=count1+(a[i]+a[n-(i+1)]);

if(count==count1)

{

for(i=0;i<(n/2);i=i+2)

{

a[i]=-a[i];

a[n-i-1]=-a[n-i-1];

}

printf("\n");

for(i=0;i<n;i++)

{

printf(" %d ",a[i]);

}

for(i=0;i<n;i++)

{

sum1=sum1+a[i];

}

printf("\n%d",sum1);

printf("\nThe numbers to be negated are: ");

printf("\n{");

for(i=0;i<(n/2);i=i+2)

{printf("%d,",a[i]);

printf("%d,",a[n-i-1]);

}

printf("}");

}}

else

{

printf("\nThe is no such combination in the following set:");

printf("\n{");

for(i=0;i<n;i++)

printf(" %d,",a[i]);

printf("}");

}

return 0;

}