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 are punctuators in c++?
How does a C++ structure differ from a C++ class?
What is the use of ::(scope resolution operator)?
What is the last index number in an array of 100 characters a) 100 b) 99 c) 101
How can you tell what shell you are running on unix system?
What will happen if a pointer is deleted twice?
Explain about Virtual Function in C++?
Write a function that swaps the values of two integers, using int* as the argument type?
Mention the purpose of istream class?
Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.
Is eclipse good for c++?
When can I use a forward declaration?
What is the latest c++ standard?
What is an overflow error?
What is a map in c++?