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


Please Help Members By Posting Answers For Below Questions

What is functions syntax in c++?

868


How important is c++?

751


What is the error in the code below and how should it be corrected?

553


Which sort does c++ use?

833


What is tellg () in c++?

1072


Which c++ operator cannot overload?

768


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

873


What is a static member?

838


What is the difference between public, private, and protected access?

840


What is c++ runtime?

874


why is c++ called oops? Explain

842


What is the basic concept of c++?

774


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

778


write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)

2070


Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers

845