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 / santosh patil
just copy elements from 5th to 4th den 6th to 5th n so
on.....at last delete the last node r set it to null
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
why and when we can declar member fuction as a private in the class?
What is data types c++?
what is c++
In the derived class, which data member of the base class are visible?
What is a list c++?
Explain about Virtual Function in C++?
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?
Implement stack operations with pointers with appropriate exception checks.
Explain unexpected() function?
What can I use instead of namespace std?
What is a block in c++?
What is stream and its types in c++?
What is the difference between prefix and postfix versions of operator++()?
What it is and how it might be called (2 methods).
Is atoi safe?