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 functions syntax in c++?
How important is c++?
What is the error in the code below and how should it be corrected?
Which sort does c++ use?
What is tellg () in c++?
Which c++ operator cannot overload?
In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that
What is a static member?
What is the difference between public, private, and protected access?
What is c++ runtime?
why is c++ called oops? Explain
What is the basic concept of c++?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers