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 the full form of ios?
What are mutator methods in c++?
Explain what you mean by a pointer.
How static variables and local variablesare similar and dissimilar?
How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
Describe the advantages of operator overloading?
Write some differences between an external iterator and an internal iterator?
What is time_t c++?
What is the best way to take screenshots of a window with c++ in windows?
How does c++ structure differ from c++ class?
Which sort does c++ use?
How do I write a c++ program?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?