program to find middle element of linklist?
Answer / abdur rab
struct node {
int data;
struct node* next;
};
int mid_element ( struct node* _node )
{
struct node* cur_ptr;
struct node* cur_next_ptr;
if ( NULL == _node ) return ( -1 );
else {
cur_ptr = _node;
cur_next_ptr = _node;
while ( ( NULL != cur_ptr -> next )
&& ( NULL != cur_next_ptr -
> next )
&& ( NULL != cur_next_ptr -
> next -> next ) )
{
cur_ptr = cur_ptr -> next;
cur_next_ptr = cur_next_ptr ->
next -> next;
}
}
return ( cur_ptr -> data );
}
| Is This Answer Correct ? | 8 Yes | 2 No |
Convert the following expression to postfix and prefix (A+B) * (D-C)
Is c procedural or functional?
what is the hexidecimal number of 4100?
Why should I use standard library functions instead of writing my own?
Write a program to remove the C comments(/* */) and C++ comments(//) from a file. The file should be declared in command line.
what is d pitfalls of registers variables
what is the difference b/w compiler and debugger?
There is a number and when the last digit is moved to its first position the resultant number will be 50% higher than the original number.Find the number?
What is string length in c?
how to find a 5th bit is set in c program
An entire structure variable can be assigned to another structure variable if __________
3 Answers Sasken, TCS, Tech Mahindra, Wipro,
How can I get back to the interactive keyboard if stdin is redirected?