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 is a multiset c++?
How would you use qsort() function to sort an array of structures?
Can I learn c++ without c?
Why do we use vector in c++?
Why do you use the namespace feature?
Who invented turbo c++?
Difference between Abstraction and encapsulation in C++?
What are the advantages of prototyping?
Is it possible to provide special behavior for one instance of a template but not for other instances?
Can recursive program be written in C++?
Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement
How does java differ from c and c++?
What is a character in c++?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
Differentiate between a constructor and a method in C++.