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 is meaning of in c++?
What is command line arguments in C++? What are its uses? Where we have to use this?
Show the declaration for a static member variable.
What is copy constructor? Can we make copy constructor private in c++?
How do I use turbo c++?
Explain the concept of dynamic allocation of memory?
How do I get good at c++ programming?
What is the use of object in c++?
Explain the concept of copy constructor?
What is the difference between an external iterator and an internal iterator?
Which one is a preferred language C or C++? Why?
Why is c++ so fast?
How a new element can be added or pushed in a stack?
What is the difference between global variables and static varables?
How delete [] is different from delete?