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
Explain the difference between struct and class in terms of access modifier.
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
Comment on c++ standard exceptions?
What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass
What is this pointer in c++?
Write a program in c++ to print the numbers from n to n2 except 5 and its multiples
Is ca high or low level language?
How do we balance an AVL Tree in C++?
What is a forward referencing and when should it be used?
What is an overflow error?
What is a breakpoint?
List different attributes in C++?
what are the events occur in intr activated on interrupt vector table
What are disadvantages of pointers?
What is a responder chain?