Find the middle node in the linked list??
(Note:Do not use for loop, count and count/2)
Answer Posted / kstarmind
Keep two pointers,
1. fast pointer moves two nodes at a time
2. slow pointer moves one node at a time
keep moving both the pointers, once the fast pointer reaches
the end node, your slow pointer would be at middle of the list.
Is This Answer Correct ? | 47 Yes | 5 No |
Post New Answer View All Answers
How can you read a directory in a C program?
What do you mean by keywords in c?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
What is type qualifiers?
What is "Duff's Device"?
What does == mean in texting?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
Is there a way to compare two structure variables?
How can you be sure that a program follows the ANSI C standard?
What is conio h in c?
What is meant by preprocessor in c?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Is there any possibility to create customized header file with c programming language?
What does the c preprocessor do?
Define circular linked list.