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 are enumerations?
Write about the scope resolution operator?
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
What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor
What is a hashmap c++?
List different attributes in C++?
What methods can be overridden in java?
What is the use of volatile variable?
What would happen on forgetting [], while deallocating an array through new?
What is meant by entry controlled loop?
What is abstraction in c++ with example?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
Is c++ low level?
What is the difference between the functions memmove() and memcpy()?