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 / ravindra
simple,
in case the list has say 90 elements, then for every 10
elements, he is writing to the array. though the array size
is 10, this is done by saying pos%10.
thus when the list is iterated he just substracts 10 from
the pos and then does %10 since he has to factor in, that
array starts from 0 and not from 1 :)
Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What does override mean in c++?
What operator is used to access a struct through a pointer a) >> b) -> c) *
What are the advantage of using register variables?
What are friend classes? What are advantages of using friend classes?
Which c++ operator cannot overload?
List down the guideline that should be followed while using friend function.
What are the types of array in c++?
Explain unexpected() function?
What is array in c++ example?
Difference between a homogeneous and a heterogeneous container
Write a program using display() function which takes two arguments.
How many keywords are used in c++?
Differentiate between the message and method in c++?
what is data encapsulation in C++?
What is meant by const_cast?