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
Write a recursive program to calculate factorial in c++.
What is prototype for that c string function?
Explain one method to process an entire string as one unit?
Briefly describe a B+ tree. What is bulk loading in it?
Is C++ case sensitive a) False b) Depends on implementation c) True
What should main() return in c and c++?
What is a dll entry point?
What is the difference between structures and unions?
How do I use arrays in c++?
What are the storage qualifiers?
Can a Structure contain a Pointer to itself?
Refer to a name of class or function that is defined within a namespace?
What are function prototypes?
Why is main function important?
Why do we use vector in c++?