Memory is not a constraint. In a single iteration(NOTE: you
can't go back), how will you find out the 10th last
node/item in a linked list.
Answer Posted / anon
Have two pointers p1 and p2.p1 points to the first node in the linked list.p2 to the tenth node.Now move both the pointer togther till p2->link = NULL.P1 is pointing to the 10th node from the last
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is ios class in c++?
What is an adjust field format flag?
What is extern c++?
What are the advantages of using a pointer?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
What is auto used for in c++?
What is the type of this pointer in c++?
Explain the static member function.
give me an example for testing a program showing the test path .show how the test is important and complex.
What is meant by forward referencing and when should it be used?
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
What are punctuators in c++?
What does new do in c++?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
How do you differentiate between overloading the prefix and postfix increments?