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 time_t c++?
How the keyword struct is different from the keyword class in c++?
Difference between a homogeneous and a heterogeneous container
How java is different from c and c++?
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
Differentiate between a template class and class template in c++?
Can you please explain the difference between using macro and inline functions?
Explain selection sorting?
What does the linker do?
What is the difference between a template and a macro?
What is the difference between ++ count and count ++?
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
What is anonymous object in c++?
How is objective c different from c++?
What is enum class in c++?