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 using namespace std in cpp?
What is the use of setprecision in c++?
Does c++ have finally?
What is split a string in c++?
Is c++ an integer?
Difference between struct and class in terms of access modifier.
Comment on c++ standard exceptions?
Describe public access specifiers?
How a macro differs from a template?
How would you use the functions memcpy(), memset(), memmove()?
What are the main features of c++?
Where can I run c++ program?
How to declare an array of pointers to integer?
When you overload member functions, in what ways must they differ?
Do class declarations end with a semicolon?