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 / aaptuster
Cant we simply check it using 10 dereferencing.
ptr -> ptr -> ptr -> ptr -> ->ptr and so on...
This could be generalized for n, as we could generate this
command string on the fly and execute the command ..
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are advantages of c++?
Can a constructor return a value?
Is vector a class in c++?
How to tokenize a string in c++?
How does atoi function work?
What are c++ redistributables?
What is the difference between public and private data members?
What are the 2 main types of data structures?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
Which is better turbo c++ or dev c++?
Write a recursive program to calculate factorial in c++.
What do you mean by “this” pointer?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
Write syntax to define friend functions in C++.
Why do we need templates?