1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision
Answer Posted / abdur rab
#include <stdio.h>
int main ( int argc, char* argv[] )
{
int* array_int, nTotalCount = 10, sbig, big, i;
printf ( "\n/********************** Second Biggest
Number ********************/" );
array_int = ( int* ) malloc ( nTotalCount * sizeof
( int ) );
for ( i = 0; i < nTotalCount; i++ )
array_int [i] = rand() % 100;
printf( "\nThe Numbers in given order" );
for ( i = 0; i < nTotalCount; i++ )
printf ( "\t%d", array_int [i] );
for ( i = 0; i < nTotalCount; i++ )
{
switch ( i )
{
case 0:
sbig = big = array_int [i];
break;
default:
if ( big < array_int [i] ) {
sbig = big;
big = array_int [i];
} else {
if ( sbig <
array_int [i] ) sbig = array_int [i] ;
}
break;
}
}
printf ( "\n sbig :%d big :%d", sbig, big );
free ( array_int );
}
For hashtable please refer the following link
http://www.geocities.com/abdur_rab7/Open_Hash/openhash.html
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
When the macros gets expanded?
Describe how arrays can be passed to a user defined function
What is difference between Structure and Unions?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
What is the advantage of using #define to declare a constant?
What is a const pointer?
what are # pragma staments?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
What is the use of a static variable in c?
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What type of function is main ()?
How can I read data from data files with particular formats?
What is time null in c?
application attempts to perform an operation?