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 is #include iostream h in c++?
List the issue that the auto_ptr object handles?
Assume an array of structure is in order by studentID field of the record, where student IDs go from 101 to 500. Write the most efficient pseudocode algorithm you can to find the record with a specific studentID if every single student ID from 101 to 500 is used and the array has 400 elements. Write the most efficient pseudocode algorithm you can to find a record with a studentID near the end of the IDs, say in the range from 450 to 500, if not every single student ID in the range of 101 to 500 is used and the array size is only 300
Is c++ vector dynamic?
When should we use container classes instead of arrays?
What does the ios::ate argument do?
What is a dll entry point?
How do you add an element to a set in c++?
an integer constant must have atleast one a) character b) digit c) decimal point
How would you find out if a linked-list is a cycle or not?
When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
Which programming language is best?
What is static in c++?
How a macro differs from a template?