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 / anon
Have two pointers p1 and p2.p1 points to the first node in the linked list.p2 to the tenth node.Now move both the pointer togther till p2->link = NULL.P1 is pointing to the 10th node from the last
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How do you define/declare constants in c++?
What is the full form nasa?
What is the v-ptr?
What is one dimensional array in c++?
Write a function to find the nth item from the end of a linked list in a single pass.
Is c++ a good first language to learn?
What is difference between array and vector in c++?
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Explain the difference between class and struct in c++?
What is the use of setprecision in c++?
Which is not a valid keyword a) public b) protected c) guarded
What is the difference between #import and #include?
What is the difference between the functions rand(), random(), srand() and randomize()?
Is c++ high level programming language?
Are there interfaces in c++?