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 / truong nguyen
Memory address of all elements in a linked list are not
continuous. So if we only know the memory address of the
element "4", we cannot know memory address of element "3"
and "5" without traversing. And we cannot remove it from the
linked list.
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What programming language should I learn first?
Why should you learn c++?
What is function overloading in C++?
What are associate containers?
What is the header file for setw?
How does class accomplish data hiding in c++?
How the programmer of a class should decide whether to declare member function or a friend function?
What is a rooted hierarchy?
Can you sort a set c++?
Can constructor be static in c++?
what is scupper?
what are the types of Member Functions?
Difference between delete and free.
What information can an exception contain?
What is the difference between object-oriented programming and procedural programming?