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
Describe linkages and types of linkages?
What is the C-style character string?
How many static variables are created if you put one static member into a template class definition?
Show the declaration for a static member variable.
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
What is & in c++ function?
Can I run c program in turbo c++?
Explain some examples of operator overloading?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
How does com provide language transparency?
What is a buffer c++?
Name the implicit member functions of a class.
Is map thread safe c++?
what is C++ objects?
What is the use of turbo c++?