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


Please Help Members By Posting Answers For Below Questions

What does override mean in c++?

573


What operator is used to access a struct through a pointer a) >> b) -> c) *

584


What are the advantage of using register variables?

632


What are friend classes? What are advantages of using friend classes?

593


Which c++ operator cannot overload?

540






List down the guideline that should be followed while using friend function.

642


What are the types of array in c++?

610


Explain unexpected() function?

578


What is array in c++ example?

638


Difference between a homogeneous and a heterogeneous container

652


Write a program using display() function which takes two arguments.

601


How many keywords are used in c++?

550


Differentiate between the message and method in c++?

602


what is data encapsulation in C++?

598


What is meant by const_cast?

642