Thursday, March 25, 2010

Little Master's massive innings support MI to gain top spot..

         Sachin Tendulkar played yet another Mumbai Indians victory with a superb half-century against the Chennai Super Kings at the Brabourne Stadium on Thursday.
        Opener Shikar Dhavan helped to make this possible with a brilliant big hits.With the win, Mumbai regained the top slot in the IPL-3 standings, and also a 3-2 lead against CSK.
        MI chased out a slighly impossible total 180 with an over remaining.

 

Wednesday, March 24, 2010

             Uthappa's Massive innings brought RCB a Super win over Chennai Super kings

               With their fourth win on the trot and their third win at home, the Royal Challengers Bangalore jumped to the top of leader board with eight points, while Chennai Supers Kings slumped to their second straight loss.
               The explosive Robin Uthappa (38-ball 68; 3x4, 6x6) piloted Royal Challengers Bangalore to a 36- run victory over the Chennai Super Kings in Match 18 of the IPL 2010 at the M Chinnaswamy Stadium here tonight.
               Longest hit: 106 m, the longest hit of the tournament so far, Robin Uthappa got under an L Balaji delivery hitting it right over the roof of the M. Chinnaswamy Stadium for a six.

Friday, October 2, 2009

ADA 5th sem lab prgms

Prgm no 5b
#include
#include
#include
int size, array[5][5],p,q,r;
void algorithm()
{
for(r=1;r<=size;++r)
for(p=1;p<=size;++p)
for(q=1;q<=size;++q)
if((array[p][r]+array[r][q]) < array[p][q])
array[p][q]=array[p][r]+array[r][q];
}
void main()
{
printf("enter the size of graph");
scanf("%d",&size);
printf("enter graph data");
for(p=1;p<=size;++p)
for(q=1;q<=size;++q)
{
scanf("%d",&array[p][q]);
if(array[p][q]==0)array[p][q]=999;
}
algorithm();
printf("shortest path");
for(p=1;p<=size;++p)
{
for(q=1;q<=size;++q)
printf("/t %d",array[p][q]);
printf("/n");
}
}

ADA 5th sem lab prgms

/* Program No. 5a
Write A C Program to find the topological ordering of vertices in the given grapgh*/
#include
#include
void main()
{
int p,q,r,vertices,num[10][10],x[10],t[10],calc=0;
printf("Enter the number of vertices: ");
scanf("%d",&vertices);
printf("Enter the Adjacency Matrix:\n");
for(p=1;p<=vertices;p++)
for(q=1;q<=vertices;q++)
scanf("%d",&num[p][q]);
for(p=1;p<=vertices;p++)
x[p]=0,t[p]=0;
for(p=1;p<=vertices;p++)
for(q=1;q<=vertices;q++)
x[p]+=num[q][p];
printf("The Topological order is: \n");
while(calc {
for(r=1;r<=vertices;r++)
if((x[r]==0)&&(t[r]==0))
{
printf("%d\t",r);
t[r]=1;
calc++;
for(p=1;p<=vertices;p++)
if(num[r][p]==1)
x[p]--;
}
}
}
/* Output:
Enter the number of vertices: 6
Enter the Adjacency Matrix:
0 0 1 1 0 0
0 0 0 1 1 0
0 0 0 1 0 1
0 0 0 0 0 1
0 0 0 0 0 1
0 0 0 0 0 0
The Topological order is:
1 2 3 4 5 6
...*/



ADA 5th sem lab prgms

/* Program No: 4.
Sort a given set of elements using the Selection Sort method..*/
#include
#include
int x[10], num;
void algorithm()
{
int m,n,situation,low,var;
for(m=0;m {
low=x[m];
situation=m;
for(n=m+1;n if(x[n] {
low=x[n],situation=n;
var=x[situation];
x[situation]=x[m];
x[m]=var;
}
}
}
void main()
{
int m,n;
printf("ENTER THE NUMBER OF ELEMENTS\n");
scanf("%d",&num);
printf("----------------------------------\n");
printf("ENTER THE %d ELEMENTS\n",num);
printf("----------------------------------\n");
for(m=0;m scanf("%d",&x[m]);
algorithm();
printf("-------------------------------------\n");
printf("THE SORTED ELEMENTS ARE\n");
printf("-------------------------------------\n");
for(m=0;m printf("%d\n",x[m]);
printf("***********************\n");
getche();
}
/*
Output:
ENTER THE NUMBER OF ELEMENTS
4
----------------------------------
ENTER THE 5 ELEMENTS
----------------------------------
20
10
40
30
-------------------------------------
THE SORTED ELEMENTS ARE
-------------------------------------
10
20
30
40
***********************
*/

ADA 5th sem lab prgms

Prgm no.3
/*Sort a given set of elements using the Merge Sort method..*/
#include
#include
int num[10], x[10];
void algorithm(int small, int s, int big)
{
int m,n,p;
p=small;
m=small;
n=s+1;
while((m<=s)&&(n<=big))
{
if(x[m] num[p++]=x[m++];
else
num[p++]=x[n++];
}
while(m<=s)
num[p++]=x[m++];
while(n<=big)
num[p++]=x[n++];
for(m=small;m<=p-1;m++)
x[m]=num[m];
}
void sort(int small,int big)
{
int s;
if(small {
s=(small+big)/2;
sort(small,s);
sort(s+1,big);
algorithm(small,s,big);
}
}
void main()
{
int i,n;
clrscr();
printf("Enter the number of Elements\n");
scanf("%d",&n);
printf("Enter the Elements\n");
for(i=0;i scanf("%d",&x[i]);
sort(0,n-1);
printf("The Sorted Element are\n");
for(i=0;i printf("%d\n",num[i]);
getche();
}

/*
Output:
Enter the number of Elements
5
Enter the Elements
20
10
50
40
30
The Sorted Element are
10
20
30
40
50
*/