Thursday, 5 December 2013

Selection Sort

v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} #include<iostream> #include<conio.h>  using namespace std; void main() { int a[100],i,n,p,k,min,loc,temp; cout<<"\n------------ SELECTION SORT ------------ \n\n"; cout<<"Enter No. of Elements="; cin>>n; cout<<"\nEnter Elements=\n"; for(i=1;i<=n;i++) { cin>>a[i]; } for(p=1;p<=n-1;p++)              // Loop for Pass { min=a[p];                        //...

Bubble Sort

#include<iostream> #include<conio.h>     using namespace std;   void main() { int a[100],i,n,p,j,temp; cout<<"\n------------ BUBBLE SORT ------------ \n\n"; cout<<"Enter No. of Elements : "; cin>>n; cout<<"\nEnter Elements : \n"; for(i=1;i<=n;i++) { cin>>a[i]; } for(p=1;p<=n-1;p++) // Loop for Pass { for(j=1;j<=n-1;j++) { if(a[j]>a[j+1]) { temp=a[j]; // Interchange Values a[j]=a[j+1]; a[j+1]=temp; } } } cout<<"\nAfter Sorting : \n"; for(i=1;i<=n;i++) { cout<<a[i]<<endl; } getch(); } Output :- ...

Linked List Searching

#include<iostream.h> #include<conio.h> struct node { int info; node *link; }; void main() { clrscr(); cout<<"\n ------- Linked List Searching -------\n\n"; node a[100]; node *start=&a[1]; int n,i,item,s=0; cout<<"Enter No. of Nodes in Linked List : "; cin>>n; cout<<"Enter Info of Nodes :\n"; for(i=1;i<=n;i++) { cout<<"Node "<<i<<" : "; cin>>a[i].info; a[i].link=&a[i+1]; } a[n].link=0; cout<<"\nEnter Item you want to Search : "; cin>>item; i=1; while(start!=0) { if(item==a[i].info) { cout<<"Item is Found at Position : "<<i; s=1; break; } else { i++; start=start->link; } } if(s==0) { cout<<"Item is Not Found"; } getch(); } Output...

Linked List Traversing

#include<iostream.h> #include<conio.h> struct node { int info; node *link; }; void main() { clrscr(); cout<<"\n ------- Linked List Traversing -------\n\n"; node a[100]; node *start=&a[1]; int n,i,item; cout<<"Enter No. of Nodes in Linked List : "; cin>>n; cout<<"\nEnter Info of Nodes :\n"; for(i=1;i<=n;i++) { cout<<"Node "<<i<<" : "; cin>>a[i].info; a[i].link=&a[i+1]; } a[n].link=0; cout<<"\nAfter Traversing : \n"; i=1; while(start!=0) { cout<<"Node "<<i<<" : "<<a[i].info<<endl; i++; start=start->link; } getch(); } Output :- ...

Control Mouse Cursor using Keyboard

Use Mouse Keys to move the Mouse pointer With Mouse Keys, you can use the Numeric Keypad on your Keyboard - instead of the mouse - to move the pointer. To Turn ON Mouse Keys in Window XP 1. Open Control Panel, Click Accessibility Options, Click the Mouse tab, and then select the Use MouseKeys check box. To Turn ON Mouse Keys in Window 7 1. Open Ease of Access Center by clicking the Start button, clicking Control Panel, clicking Ease of Access,and then clicking Ease of Access Center. 2. Click Make the mouse easier to use. 3. Under Control the mouse with the keyboard, select the Turn ON Mouse Keys check box. Moving the pointer using Mouse Keys After you Turn ON Mouse Keys, you can use the Numeric keypad to...

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons