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

Write a recursive program to calculate factorial in c++.

798


What is prototype for that c string function?

861


Explain one method to process an entire string as one unit?

1202


Briefly describe a B+ tree. What is bulk loading in it?

970


Is C++ case sensitive a) False b) Depends on implementation c) True

788






What should main() return in c and c++?

731


What is a dll entry point?

725


What is the difference between structures and unions?

775


How do I use arrays in c++?

752


What are the storage qualifiers?

869


Can a Structure contain a Pointer to itself?

778


Refer to a name of class or function that is defined within a namespace?

823


What are function prototypes?

948


Why is main function important?

805


Why do we use vector in c++?

767