Can we remove an element in a single linked list without
traversing?
Lets suppose the link list is like this
1 2 3 4 5 6
We need to remove 4 from this list (without traversing from
beginning) and the final link list shud be 1 2 3 5 6
only thing we know is the pointer to element "4". How can
we remove "4" and link "3" to "5"?
Answer Posted / mpoleg
1) copy content of element 5 to element 4
2) link element 4(which already contains number 5) to
element 6
3) delete element 5
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
Is map thread safe c++?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?
What is pure virtual function? Or what is abstract class?
Is it possible to get the source code back from binary file?
What is math h in c++?
Who calls main function?
In the derived class, which data member of the base class are visible?
What is a .lib file in c++?
Write an algorithm that determines whether or not an almost complete binary tree is a heap.
Out of fgets() and gets() which function is safe to use?
What is the full form of dos?
How to declare a function pointer?
Explain terminate() function?
What information can an exception contain?
Define a nested class.