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
How do you declare A pointer to a function which receives nothing and returns nothing
Why can templates only be implemented in the header file?
Can you please explain the difference between overloading and overriding?
Is java made in c++?
What is the difference between a type-specific template friend class and a general template friend class?
What is using namespace std in cpp?
How does work in c++?
How can you create a virtual copy constructor?
Explain the use of virtual destructor?
What is public, protected, private in c++?
what are the types of Member Functions?
What is stoi in c++?
Can constructor be private in c++?
What is the difference between a declaration and a definition?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?