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 / mms zubeir
I got it, thank you.
but one suggestion, instead of using
printf("Tenth last element is %d",nodes[(pos-10)%10]->data);
you can simply give,
printf("Tenth last element is %d",nodes[pos%10]->data);
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Which of the following is evaluated first: a) && b) || c) !
What is type of 'this' pointer?
What is late binding c++?
Is string data type in c++?
What data encapsulation is in c++?
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
What is the size of a vector?
what Is DCS ? what i will get benefit when i did?
What is one dimensional array in c++?
What does ctime() do?
What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
what is oops and list its features in c++?
What are the advantages of using typedef in a program?
Show the declaration for a static member variable.