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


Please Help Members By Posting Answers For Below Questions

What is time_t c++?

608


How the keyword struct is different from the keyword class in c++?

582


Difference between a homogeneous and a heterogeneous container

661


How java is different from c and c++?

643


write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num

2196






Differentiate between a template class and class template in c++?

634


Can you please explain the difference between using macro and inline functions?

528


Explain selection sorting?

638


What does the linker do?

594


What is the difference between a template and a macro?

584


What is the difference between ++ count and count ++?

579


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3356


What is anonymous object in c++?

632


How is objective c different from c++?

792


What is enum class in c++?

708