diff --git a/Linear_probing.c b/Linear_probing.c new file mode 100644 index 0000000..0acbfd3 --- /dev/null +++ b/Linear_probing.c @@ -0,0 +1,92 @@ +#include +#include +#define TABLE_SIZE 10 + +int h[TABLE_SIZE]={NULL}; + +void insert() +{ + int key,i,hkey,index; + printf("\nEnter the key to insert:"); + scanf("%d",&key); + hkey=key%TABLE_SIZE; + for(i=0;i +using namespace std; + +double power(double a,int b = 2) +{ + double x=1; + for(int i=1;i<=b;i++) + x=x*a; + + return x; +} + +int main() +{ + int p; + double n,r; + cout<<" Enter number: "; + cin>>n; + cout<<"Enter exponent: "; + cin>>p; + r = power(n,p); + cout<<"\nresult without passing exponent is "<