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

the first character in the variable name must be an a) special symbol b) number c) alphabet

595


What causes a runtime error c++?

568


How do you establish a has-a relationship?

603


Define upcasting.

583


Explain how overloading takes place in c++?

565






What is the best c++ compiler?

584


What is #include iostream?

727


How much do c++ programmers make?

551


Do you need a main function in c++?

545


Where do I find the current c or c++ standard documents?

573


What is the basic concept of c++?

566


Describe delete operator?

614


Explain stack unwinding.

626


Is c++ platform dependent?

625


In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that

606