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 enum c++?
What can I safely assume about the initial values of variables which are not explicitly initialized?
Comment on local and global scope of a variable.
What is the use of map in c++?
Write a program using display() function which takes two arguments.
Is recursion allowed in inline functions?
Is c++ slower than c?
What are the basics of local (auto) objects?
Explain the problem with overriding functions
What is a c++ vector?
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
Describe friend function & its advantages.
What do you mean by early binding?
Describe the process of creation and destruction of a derived class object?
How does a copy constructor differs from an overloaded assignment operator?