Search:

Submit Article

# Program of address calculation sort

Posted By: Easy Tutor     Category: C++ Programming     Views: 25326

## Code for Program of address calculation sort in C++ Programming

```//Address Calculation sort

#include<iostream.h>
#include<stdio.h>
#include<conio.h>

int num;
public :
void getdata();
int process(int);
void display();
};

for(int i=0;i<20;i++)
{
hash_table[i]->num=i;
hash_table[i]->next=NULL;
}
}

{
int info,rendom;
char ans;
do
{
cout<<endl<<"Enter the info (1 to 100):";
cin>>info;
if(info<1 || info>100)
{
cout<<endl<<"Not possible:";
break;
}
else
{
n1->num=info;
n1->next=NULL;
rendom=process(info);
if(hash_table[rendom]->next==NULL)
hash_table[rendom]->next=n1;
else
{
p=hash_table[rendom];
s=p->next;
while(s!=NULL && s->num < info)
{
p=s;
s=s->next;
}
if(s==NULL)
{
p->next=n1;
}
else
{
p->next=n1;
n1->next=s;
}
}
}
cout<<endl<<"do u want to continue[y/n]:";
fflush(stdin);
cin>>ans;
}while(ans!='n');
int i=0;
while(hash_table[i]->next==NULL && i<20)
{
i=i+1;
}
int j=i+1;
while(j<20)
{
if(hash_table[j]->next!=NULL)
{
p=hash_table[i]->next;
while(p->next!=NULL)
p=p->next;
p->next=hash_table[j]->next;
i=j;
j=j+1;
}
else
j++;
}
}

{
while(temp!=NULL)
{
cout<<endl<<temp->num;
temp=temp->next;
}
cout<<endl<<temp->num;
}

{
int i=0;
int t=info/10;
for(i=0;i<=t;i++)
{
if(i==0&&i==t)
return(i);
elseif(i==t)
return(i);
}
}

void main(){
clrscr();
a.getdata();
a.display();
getch();
}```
Share:

Didn't find what you were looking for? Find more on Program of address calculation sort Or get search suggestion and latest updates.

 Easy Tutor author of Program of address calculation sort is from United States. Easy Tutor says Hello Friends,I am Free Lance Tutor, who helped student in completing their homework. I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] comI have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada. I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.Thanks,Happy Programming :) View All Articles

 Please enter your CommentComment should be atleast 30 Characters.Please put code inside [Code] your code [/Code]. No Comment Found, Be the First to post comment!