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
In what situations do you have to use initialization list rather than assignment in constructors?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
What is encapsulation in c++?
What is a local variable?
Explain the advantages of using friend classes.
What is constructor c++?
What is the use of lambda in c++?
Is java based off c++?
What are the differences between malloc() and calloc()?
what is Member Functions in Classes?
explain the reference variable in c++?
What is difference between array and vector in c++?
Write about the use of the virtual destructor?
What are disadvantages of pointers?
What is scope operator in c++?