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
Is java a c++?
What is a try block?
Difference between an inspector and a mutator
Can you overload the operator+ for short integers?
How do you flush a buffer in c++?
What is null pointer and void pointer and what is their use?
How should a contructor handle a failure?
Explain class invariant.
What is binary object model?
write a programme to get a character and thier ASCII value
What is a virtual destructor? Explain the use of it?
What are the storage qualifiers?
What does the linker do?
What are the types of array in c++?
Is swift better than c++?