Friday, November 14, 2014

எளிய தமிழில் GNU/Linux – பாகம்-1,பாகம்-2 PDF BOOKS


GNU/Linux – இது மென்பொருள் உலகை புரட்டிப்போட்ட ஒரு இயங்குதளம்.
இதை, இந்த நூல் எளிமையாக அறிமுகம் செய்கிறது.
GNU/Linux-ன் அடிப்படைகளை தக்க உதாரணங்களுடன் விளக்குகிறது.

Part1 book






Part2 book



Friday, November 7, 2014

Data structure And algortham coding (c++)

Arrays and Matrices:

01. To find largest/second largest from an array of integers.
02. To print lower triangular matrix.
03. To check whether the given matrix is a magic square.
04. To insert,delete,traverse in Array.
05. To check symmetry of a matrix.
06. To reverse an Array.
07. To delete repetitive elements in an Array.
08. To display Tridiagonal Matrix.

Linked Lists, Stacks and Queues:

09. Insertion,deletion,traversal- Singly Linked List.
10. Insertion,deletion,traversal- Doubly Linked List.
11. Stack as Array.
12. Stack as Linked List.
13. Linear Queue as Array.
14. Linear Queue as Linked List.

Sorting Techniques:

15. Bubble Sort.
16. Selection Sort.
17. Insertion Sort.
18. Heap Sort.
19. Merge Sort.
20. Quick Sort.


01. To find largest/second largest from an array of integers.

#include<iostream.h>
#include<conio.h>
void main()
{
int a[100],n,i,j,flag=0;
clrscr();
cout<<"\n\nHow many nos. do you want to enter\n\n";
cin>>n;
cout<<"\n\nEnter nos.\n\n";
for(i=0;i!=n;i++)
cin>>a[i];
for(j=32767;j!=-32768;j--)
{
for(i=0;i!=n;i++)
{
if((flag==0)&&(a[i]==j)){cout<<"Largest= "<<j<<"\n\n"; flag=1;continue;}
if((flag==1)&&(a[i]==j)){cout<<"Second Largest= "<<j<<"\n\n"; goto X;}
}
}
X:
getch();
}

02. To print lower triangular matrix.

#include<iostream.h>
#include<conio.h>
void main()
{
int a[100][100],m,n,i,j;
clrscr();
cout<<"\n\nEnter no. of rows\n\n";
cin>>m;
cout<<"Enter no. of columns\n\n";
cin>>n;
cout<<"Enter elements\n\n";
for(i=0;i!=m;i++)
for(j=0;j!=n;j++)
cin>>a[i][j];
cout<<"\n\nLower Triangular Matrix:\n\n";
for(i=0;i!=m;i++)
{
for(j=0;j!=i+1;j++)
{
cout<<a[i][j];
cout<<" ";
}
cout<<"\n";
}
getch();
}

03. To check whether the given matrix is a magic square.

#include<iostream.h>
#include<conio.h>
void main()
{
int a[100][100],m,n,i,j,flagx=1;
int *sum;
clrscr();
cout<<"\n\nEnter no. of rows\n\n";
cin>>m;
cout<<"Enter no. of columns\n\n";
cin>>n;
if(m!=n)
{
cout<<"\n\nNot a sqaure matrix, hence not a magic square!\n\n";
goto Y;
}
sum=new int[m+n+2];
cout<<"Enter elements\n\n";
for(i=0;i!=m;i++)
{
sum[i]=0;
for(j=0;j!=n;j++)
{
cin>>a[i][j];
sum[i]+=a[i][j];
}
}
for(j=0;j!=n;j++)
{
sum[m+j]=0;
for(i=0;i!=m;i++)
{
sum[m+j]+=a[i][j];
}
}
sum[m+n]=0;
for(i=0;i!=m;i++)
{
sum[m+n]+=a[i][i];
}
sum[m+n+1]=0;
for(i=0,j=n-i-1;i!=m;i++)
{
sum[m+n+1]+=a[i][j];
}
for(i=0;i!=(m+n+1);i++)
{
if(sum[i]!=sum[i+1]){cout<<"Not a magic square\n\n";flagx=0;break;}
}
if(flagx==1){cout<<"Magic Square\n\n";}
Y:
getch();
}

04. To insert,delete,traverse in Array.

#include<iostream.h>
#include<conio.h>
void arr_tra(int a[],int size)
{
int i;
for(i=0;i<size;i++)
{
cout<<a[i]<<"\n";
}
getch();
}
int arr_del(int a[],int size,int num)
{
int pos=-1;
int i;
for(i=0;i!=size;i++)
{
if(a[i]==num){pos=i;break;}
}
if(pos==-1)
{
cout<<"Number does not exist in the entered array\n\n";
return size;
}
else
{
for(i=0;i!=pos;i++){}
i++;
for(;i<size;i++)
{
a[i-1]=a[i];
}
return size-1;
}
}
int arr_ins(int a[],int size,int num,int pos)
{
int i;
for(i=size-1;i>=pos;i--)
{
a[i+1]=a[i];
}
i++;
a[i]=num;
return size+1;
}
void main()
{
int a[10],ch,size,num,pos;
char ch2;
clrscr();
cout<<"How many elements do you want to enter\n\n";
cin>>size;
cout<<"Enter elements\n\n";
for(int i=0;i!=size;i++)
{
cin>>a[i];
}
do
{
clrscr();
cout<<"Enter your choice:\n\n";
cout<<"1-TRAVERSE\n";
cout<<"2-INSERT\n";
cout<<"3-DELETE\n";
cin>>ch;
switch(ch)
{
case 1: clrscr();
 arr_tra(a,size);
 clrscr();
 break;
case 2: clrscr();
 cout<<"\n\nEnter number to insert\n\n";
 cin>>num;
 cout<<"\n\nEnter position to insert\n\n";
 cin>>pos;
 size=arr_ins(a,size,num,pos-1);
 clrscr();
 break;
case 3: clrscr();
 cout<<"\n\nEnter number to delete\n\n";
 cin>>num;
 size=arr_del(a,size,num);
 clrscr();
 break;
default: cout<<"\n\nInvalid Choice!!\n\n";
}
cout<<"Want to continue? (Y-yes|N-no)\n\n";
cin>>ch2;
}
while((ch2=='Y')||(ch2=='y'));
}

05. To check symmetry of a matrix.
#include<iostream.h>
#include<conio.h>
void main()
{
int **a,**b,flag=1;
int m,n;
clrscr();
cout<<"\nEnter no. of rows\n";
cin>>m;
cout<<"\nEnter no. of columns\n";
cin>>n;
a=new int *[m];
for(int i=0;i!=m;i++)
a[i]=new int[n];
b=new int *[n];
for(int j=0;j!=n;j++)
b[j]=new int[m];
cout<<"\n\nEnter elements\n";
for(i=0;i!=m;i++)
for(j=0;j!=n;j++)
cin>>a[i][j];
for(i=0;i!=m;i++)
for(j=0;j!=n;j++)
{
b[i][j]=a[j][i];
if((flag==1)&&(a[i][j]!=b[i][j]))
{flag=0;}
}
if(flag==0)
{
for(i=0;i!=m;i++)
for(j=0;j!=n;j++)
if((flag==0)&&(b[i][j]!=-a[i][j]))
{flag=2;}
}
if(flag==1){cout<<"\n\nSymmetric Matrix\n";}
else if(flag==0){cout<<"\nSkew-Symmetric Matrix\n";}
else{cout<<"\nNeither Symmetric nor Skew-Symmetric\n";}
getch();
}

06. To reverse an Array.

#include<iostream.h>
#include<conio.h>
void arr_rev(int *ptr,int size)  //REVERSE
{
int i,temp;
for(i=size-1;i!=0;i-=2,ptr++)
{
temp=*ptr;
*ptr=*(ptr+i);
*(ptr+i)=temp;
}
}
void main()
{
int *arr;
int m,i;
clrscr();
cout<<"\nHow many elements do you want to enter?\n";
cin>>m;
arr=new int[m];
cout<<"\nEnter elements\n";
for(i=0;i!=m;i++)
cin>>arr[i];
arr_rev(arr,m);
cout<<"\nReversed array:\n";
for(i=0;i!=m;i++)
cout<<arr[i]<<" ";
getch();
}

07. To delete repetitive elements in an Array.

#include<iostream.h>
#include<conio.h>
int arr_del(int a[],int size,int pos)
{
int i;
for(i=0;i!=pos;i++){}
i++;
for(;i<size-1;i++)
{
a[i-1]=a[i];
}
return size-1;
}
void main()
{
int a[10];
int i,j,size=10,flag;
clrscr();
cout<<"Enter 10 integers\n\n";
for(i=0;i!=10;i++)
cin>>a[i];
for(i=0;i<size-1;i++)
{
flag=0;
for(j=i+1;j<size;j++)
{
if(a[i]==a[j])
{
size=arr_del(a,size,j);
flag=1;
j--;
}
}
if(flag==1)
{
size=arr_del(a,size,i);
flag=0;
i--;
}
}
clrscr();
cout<<"\n\nNew Array:\n\n";
for(i=0;i!=size;i++)
cout<<a[i];
getch();
}


08.To display Tridiagonal Matrix.

#include<iostream.h>
#include<conio.h>
void main()
{
int a[5][5];
int b[13];
int i,j;
clrscr();
cout<<"\nEnter the tridiagonal elements of a 5*5 tridiagonal matrix\n\n";
for(i=0;i!=13;i++)
cin>>b[i];
for(i=0;i!=5;i++)
for(j=0;j!=5;j++)
a[i][j]=0;
for(i=0;i!=5;i++)
a[i][i]=b[3*i];
for(i=0;i!=4;i++)
{
a[i][i+1]=b[3*i+1];
a[i+1][i]=b[3*i+2];
}
cout<<"\n\nTridiagonal Matrix:\n\n";
for(i=0;i!=5;i++)
{
for(j=0;j!=5;j++)
cout<<a[i][j]<<" ";
cout<<endl;
}
getch();
}

09. Insertion,deletion,traversal- Singly Linked List.

#include<iostream.h>
#include<conio.h>
struct Node
{
int info;
Node *next;
}*start,*temp,*p,*q;
void traverse()
{
if(start==NULL){cout<<"\nUnderflow\n";}
else
{
cout<<endl;
for(temp=start;temp!=NULL;temp=temp->next)
cout<<temp->info<<" ";
}
}
void insert_beg()
{
p=new Node;
cout<<"\nEnter Node->info\n";
cin>>p->info;
p->next=start;
start=p;
}
void insert_end()
{
if(start==NULL){insert_beg();}
else
{
for(temp=start;temp->next!=NULL;temp=temp->next)
{}
p=new Node;
cout<<"\nEnter Node->info\n";
cin>>p->info;
temp->next=p;
p->next=NULL;
}
}
void insert_mid()
{
int loc,n;
p=new Node;
cout<<"\nEnter Node->info\n";
cin>>p->info;
cout<<"\nEnter Node location\n";
cin>>loc;
if(loc==1)
{
p->next=start;
start=p;
}
else
{
for(n=1,temp=start;temp->next!=NULL,n<loc-1;temp=temp->next,n++)
{
}
if(n<loc-1){cout<<"\nLocation Overflow\n";}
else
{
p->next=temp->next;
temp->next=p;
}
}
}
void del_beg()
{
if(start==NULL){cout<<"\nUnderflow\n";}
else
{
temp=start;
start=start->next;
temp->next=NULL;
}
}
void del_end()
{
if(start==NULL){cout<<"\nUnderflow\n";}
else if(start->next==NULL){del_beg();}
else
{
for(temp=start;temp->next->next!=NULL;temp=temp->next)
{}
temp->next=NULL;
}
}
void del_mid()
{
int loc,n;
if(start==NULL){cout<<"\nUnderflow\n";}
else
{
cout<<"\nEnter Node location\n";
cin>>loc;
if(loc==1){del_beg();}
else
{
for(n=1,temp=start;temp->next!=NULL,n<loc-1;temp=temp->next,n++)
{}
if(n<loc-1){cout<<"\nLocation Overflow\n";}
else
{
q=temp->next;
temp->next=q->next;
q->next=NULL;
}
}
}
}
void main()
{
int ch;
char ch2;
clrscr();
do
{
cout<<"\n\nEnter your choice:\n";
cout<<"1-Traverse\n";
cout<<"2-Insert at beginning\n";
cout<<"3-Insert at last\n";
cout<<"4-Insert at location\n";
cout<<"5-Delete at beginning\n";
cout<<"6-Delete at last\n";
cout<<"7-Delete at location\n";
cin>>ch;
switch(ch)
{
case 1:traverse();break;
case 2:insert_beg();break;
case 3:insert_end();break;
case 4:insert_mid();break;
case 5:del_beg();break;
case 6:del_end();break;
case 7:del_mid();break;
default:cout<<"\n\nInvalid Choice!!";
}
cout<<"\n\nWant to continue? (Y-yes|N-no)\n";
cin>>ch2;
}
while((ch2=='Y')||(ch2=='y'));
}


10. Insertion,deletion,traversal- Doubly Linked List.

#include<iostream.h>
#include<conio.h>
struct Node
{
int info;
Node *next;
Node *prev;
}*start,*temp,*p,*q;
void traverse()
{
if(start==NULL){cout<<"\nUnderflow\n";}
else
{
cout<<endl;
for(temp=start;temp!=NULL;temp=temp->next)
cout<<temp->info<<" ";
}
}
void insert_beg()
{
p=new Node;
cout<<"\nEnter Node->info\n";
cin>>p->info;
p->prev=NULL;
start->prev=p;
p->next=start;
start=p;
}
void insert_end()
{
if(start==NULL){insert_beg();}
else
{
for(temp=start;temp->next!=NULL;temp=temp->next)
{}
p=new Node;
cout<<"\nEnter Node->info\n";
cin>>p->info;
p->prev=temp;
temp->next=p;
p->next=NULL;
}
}
void insert_mid()
{
int loc,n;
p=new Node;
cout<<"\nEnter Node->info\n";
cin>>p->info;
cout<<"\nEnter Node location\n";
cin>>loc;
if(loc==1)
{
p->prev=NULL;
start->prev=p;
p->next=start;
start=p;
}
else
{
for(n=1,temp=start;temp->next!=NULL,n<loc-1;temp=temp->next,n++)
{}
if(n<loc-1){cout<<"\nLocation Overflow\n";}
else
{
p->prev=temp;
temp->next->prev=p;
p->next=temp->next;
temp->next=p;
}
}
}
void del_beg()
{
if(start==NULL){cout<<"\nUnderflow\n";}
else
{
temp=start;
start=start->next;
start->prev=NULL;
temp->next=NULL;
}
}
void del_end()
{
if(start==NULL){cout<<"\nUnderflow\n";}
else if(start->next==NULL){del_beg();}
else
{
for(temp=start;temp->next->next!=NULL;temp=temp->next)
{}
temp->next->prev=NULL;
temp->next=NULL;
}
}
void del_mid()
{
int loc,n;
if(start==NULL){cout<<"\nUnderflow\n";}
else
{
cout<<"\nEnter Node location\n";
cin>>loc;
if(loc==1){del_beg();}
else
{
for(n=1,temp=start;temp->next!=NULL,n<loc-1;temp=temp->next,n++)
{}
if(n<loc-1){cout<<"\nLocation Overflow\n";}
else
{
q=temp->next;
q->prev=NULL;
q->next->prev=temp;
temp->next=q->next;
q->next=NULL;
}
}
}
}
void main()
{
int ch;
char ch2;
clrscr();
do
{
cout<<"\n\nEnter your choice:\n";
cout<<"1-Traverse\n";
cout<<"2-Insert at beginning\n";
cout<<"3-Insert at last\n";
cout<<"4-Insert at location\n";
cout<<"5-Delete at beginning\n";
cout<<"6-Delete at last\n";
cout<<"7-Delete at location\n";
cin>>ch;
switch(ch)
{
case 1:traverse();break;
case 2:insert_beg();break;
case 3:insert_end();break;
case 4:insert_mid();break;
case 5:del_beg();break;
case 6:del_end();break;
case 7:del_mid();break;
default:cout<<"\n\nInvalid Choice!!";
}
cout<<"\n\nWant to continue? (Y-yes|N-no)\n";
cin>>ch2;
}
while((ch2=='Y')||(ch2=='y'));
}
//11. Stack as Array.#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<dos.h>
void main()
{
int stack[10];
int top=-1;
int ch,i;
char ans;
do{
clrscr();
cout<<"1.PUSH Elements\n";
cout<<"2.POP Elements\n";
cout<<"3.DISPLAY Elements\n";
cout<<"Enter your choice\n\n";
cin>>ch;
switch(ch)
{
case 1:
top+=1;
if(top>9)
{
top-=1;
cout<<"\n\nStack if full\n\n";
}
else
{
cout<<"\n\nEnter Info\n\n";
cin>>stack[top];
}
break;
case 2:
if(top==-1)
{
cout<<"\n\nStack is empty\n\n";
}
else
{
cout<<"\n\nThe deleted info is "<<stack[top];
top-=1;
}
break;
case 3:
cout<<"\n\n";
if(top==-1)
{
cout<<"\n\nStack is empty\n\n";
}
else
{
for(i=top;i>=0;i--)
{
cout<<stack[i]<<"\n";
}
}
break;
default: cout<<"\n\nInvalid Choice\n\n";
}
cout<<"\n\nContinue (Y/N) ?\n\n";
cin>>ans;
}
while((ans=='Y')||(ans=='y'));
}
12. Stack as Linked List.
#include<iostream.h>
#include<conio.h>
struct Node
{
int info;
Node *next;
}*top,*temp,*p;
void display()
{
if(top==NULL){cout<<"\nUnderflow\n";}
else
{
cout<<endl;
for(temp=top;temp!=NULL;temp=temp->next)
cout<<temp->info<<" ";
}
}
void push()
{
p=new Node;
cout<<"\nEnter Node->info\n";
cin>>p->info;
p->next=top;
top=p;
}
void pop()
{
if(top==NULL){cout<<"\nUnderflow\n";}
else
{
temp=top;
top=top->next;
temp->next=NULL;
}
}
void main()
{
int ch;
char ch2;
do
{
cout<<"\n\nEnter your choice:\n";
cout<<"1-Display\n";
cout<<"2-Push\n";
cout<<"3-Pop\n";
cin>>ch;
switch(ch)
{
case 1:display();break;
case 2:push();break;
case 3:pop();break;
default:cout<<"\n\nInvalid Choice!!";
}
cout<<"\n\nWant to continue? (Y-yes|N-no)\n";
cin>>ch2;
}
while((ch2=='Y')||(ch2=='y'));
}

13. Linear Queue as Array.

#include<iostream.h>
#include<conio.h>
void main()
{
int queue[10],front,rear;
front=rear=-1;
int ch;
char ans;
do
{
clrscr();
cout<<"1.ENQUEUE\n";
cout<<"2.DEQUEUE\n";
cout<<"3.TRAVERSE\n\n";
cout<<"Enter your choice\n\n";
cin>>ch;
switch(ch)
{
case 1:
if(front==-1){front=0;}
rear+=1;
if(rear>9)
{
rear-=1;
cout<<"\n\nQueue is full, cannot insert\n\n";
}
else
{
cout<<"\n\nEnter element\n\n";
cin>>queue[rear];
}
break;
case 2:
if(front==-1)
{
cout<<"\n\nQueue is empty\n";
}
else
{
cout<<"\n\nThe deleted element is "<<queue[front];
front+=1;
if(front==rear+1){front=rear=-1;}
}
break;
case 3:
cout<<"\n\n";
if(front==-1)
{
cout<<"\n\nQueue is empty\n";
}
else
{
for(int i=front;i<=rear;i++)
{
cout<<queue[i]<<"\n";
}
}
break;
default: cout<<"\n\nInvalid Choice\n\n";
}
cout<<"\n\nContinue (Y/N) ?\n\n";
cin>>ans;
}
while((ans=='Y')||(ans=='y'));
}

14. Linear Queue as Linked List.

#include<iostream.h>
#include<conio.h>
struct Node
{
int info;
Node *next;
}*rear,*temp,*p;
Node *front=rear->next;
void traverse()
{
if(front==rear->next){cout<<"\nUnderflow\n";}
else
{
cout<<endl;
for(temp=front;temp!=rear->next;temp=temp->next)
cout<<temp->info<<" ";
}
}
void enqueue()
{
p=new Node;
cout<<"\nEnter Node->info\n";
cin>>p->info;
if(front==rear->next)
{
front=p;
rear=p;
p->next=NULL;
}
else
{
rear->next=p;
p->next=NULL;
rear=p;
}
}
void dequeue()
{
if(front==rear->next){cout<<"\nUnderflow\n";}
else
{
temp=front;
front=front->next;
temp->next=NULL;
}
}
void main()
{
int ch;
char ch2;
do
{
cout<<"\n\nEnter your choice:\n";
cout<<"1-Traverse\n";
cout<<"2-Enqueue\n";
cout<<"3-Dequeue\n";
cin>>ch;
switch(ch)
{
case 1:traverse();break;
case 2:enqueue();break;
case 3:dequeue();break;
default:cout<<"\n\nInvalid Choice!!";
}
cout<<"\n\nWant to continue? (Y-yes|N-no)\n";
cin>>ch2;
}
while((ch2=='Y')||(ch2=='y'));
}

15. Bubble Sort.

#include<iostream.h>
#include<conio.h>
void bsort(int arr[],int size)
{
for(int n=size;n>=1;n--)
{
for(int i=1;i<=n-1;i++)
{
if(arr[i]>arr[i+1])
{
int temp=arr[i];
arr[i]=arr[i+1];
arr[i+1]=temp;
}
}
}
}
void main()
{
int arr[11];
clrscr();
cout<<"\nEnter 10 elements\n";
for(int i=1;i<=10;i++)
cin>>arr[i];
bsort(arr,10);
cout<<"\nSorted Array:\n\n";
for(i=1;i<=10;i++)
cout<<arr[i]<<" ";
getch();
}

 Selection Sort.

#include<iostream.h>
#include<conio.h>
void ssort(int arr[],int size)
{
for(int j=1;j<=size-1;j++)
{
int min=arr[j];
int pos=j;
for(int i=j+1;i<=size;i++)
{
if(min>arr[i]){min=arr[i];pos=i;}
}
int temp=arr[j];
arr[j]=arr[pos];
arr[pos]=temp;
}
}
void main()
{
int arr[11];
clrscr();
cout<<"\nEnter 10 elements\n";
for(int i=1;i<=10;i++)
cin>>arr[i];
ssort(arr,10);
cout<<"\nSorted Array:\n\n";
for(i=1;i<=10;i++)
cout<<arr[i]<<" ";
getch();
}

Insertion Sort.

#include<iostream.h>
#include<conio.h>
void isort(int arr[],int size)
{
arr[0]=-32768;
for(int k=2;k<=size;k++)
{
int temp=arr[k];
int ptr=k-1;
while(temp<arr[ptr])
{
arr[ptr+1]=arr[ptr];
ptr--;
}
arr[ptr+1]=temp;
}
}
void main()
{
int arr[11];
clrscr();
cout<<"\nEnter 10 elements\n";
for(int i=1;i<=10;i++)
cin>>arr[i];
isort(arr,10);
cout<<"\nSorted Array:\n\n";
for(i=1;i<=10;i++)
cout<<arr[i]<<" ";
getch();
}

//18. Heap Sort.

#include<iostream.h>
#include<conio.h>
void main()
{
int a[11];
clrscr();
cout<<"\n\nEnter 10 elements\n\n";
for(int i=1;i<=10;i++)
cin>>a[i];
int n,temp,size=10;
for(n=size;n>=1;n--)
{
for(i=n;i>=2;i--)
{
if(a[i]>a[i/2])
{
temp=a[i];
a[i]=a[i/2];
a[i/2]=temp;
}
}
temp=a[n];
a[n]=a[i];
a[i]=temp;
}
cout<<"\n\nSorted Array:\n\n";
for(i=1;i<=10;i++)
cout<<" "<<a[i];
getch();
}

19. Merge Sort.

#include<iostream.h>
#include<conio.h>
void merge(int A[],int p,int q,int r)
{
int n1=q-p+1;
int n2=r-q;
int *L;
int *R;
L=new int[n1+2];
R=new int[n2+2];
for(int i=1;i<=n1;i++)
{L[i]=A[p+i-1];}
for(int j=1;j<=n2;j++)
{R[j]=A[q+j];}
L[n1+1]=32767;
R[n2+1]=32767;
i=1;
j=1;
for(int k=p;k<=r;k++)
{
if(L[i]<R[j]){A[k]=L[i];i++;}
else{A[k]=R[j];j++;}
}
}
void merge_sort(int A[],int p,int r)
{
if(p<r)
{
int q=(p+r)/2;
merge_sort(A,p,q);
merge_sort(A,q+1,r);
merge(A,p,q,r);
}
}
void main()
{
int a[11];
clrscr();
cout<<"\n\nEnter 10 elements\n\n";
for(int i=1;i<=10;i++)
cin>>a[i];
merge_sort(a,1,10);
cout<<"\n\nSorted Array:\n\n";
for(i=1;i<=10;i++)
cout<<" "<<a[i];
getch();
}
20. Quick Sort. [SOME ERRORS]
#include<iostream.h>
#include<conio.h>
int partition(int A[],int p,int r)
{
int x=A[r];
int i=p-1;
int temp;
for(int j=p;j<=r-1;j++)
{
if(A[j]<=x){i++;}
else
{
temp=A[i];
A[i]=A[j];
A[j]=temp;
}
}
temp=A[i+1];
A[i+1]=A[r];
A[r]=temp;
return(i+1);
}
void quicksort(int A[],int p,int r)
{
if(p<r)
{
int q=partition(A,p,r);
quicksort(A,p,q-1);
quicksort(A,q+1,r);
}
}
void main()
{
int a[11];
clrscr();
cout<<"\n\nEnter 10 elements\n\n";
for(int i=1;i<=10;i++)
cin>>a[i];
quicksort(a,1,10);
cout<<"\n\nSorted Array:\n\n";
for(i=1;i<=10;i++)
cout<<" "<<a[i];
getch();
}

Wednesday, October 29, 2014

தமிழில் போட்டோசாப் பாடம்

Photoshop Training in Tamil.




இந்த லிங்கை கிளிக் செய்யுங்கள்......

http://tamilpctraining.blogspot.com/p/1-50.html?m=1

What is a network?? (tamil)


What is a network?? (tamil)



 

Data Communication In Tamil....

1.communication methods..


 

Saturday, August 16, 2014

OSI model tutorial (tamil)

easy  to understand OSI MODEL



Click Here to Download

Tamil-computer Hardware-Notes

Read in tamil

Friday, August 15, 2014

Wednesday, August 13, 2014

system analysis and design



system analysis and design


JAVA PROGRAMING TAMIL NOTES



JAVA TAMIL TUTORIALS..












Friday, August 8, 2014