Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the two types of structure?

1077


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

1226


What is the ANSI C Standard?

1252


I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1928


Why we use void main in c?

1147


Explain logical errors? Compare with syntax errors.

1058


What is #define?

1093


What are called c variables?

1044


What is static and volatile in c?

1213


The statement, int(*x[]) () what does in indicate?

1129


Explain pointers in c programming?

1098


How can I avoid the abort, retry, fail messages?

1122


Explain what is the difference between the expression '++a' and 'a++'?

1203


Write the Program to reverse a string using pointers.

1003


Explain how do you print an address?

1126