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 / codeg

it is not possible in Single AND double linked list without
traversing from first and not knowing addr of 4..
its possible in circular doubly linked list only........

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know what is overriding?

833


Do you know what are static and dynamic type checking?

854


Explain how a pointer to function can be declared in C++?

796


Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()

1289


Difference between inline functions and macros?

796


What is the use of vtable?

920


What is a linked list in c++?

813


What is insertion sorting?

885


What is null c++?

850


Describe linkages and types of linkages?

797


Why is it called c++?

803


What is a sequence in c++?

792


What is doubly linked list in c++?

857


What is using namespace std in cpp?

791


How one would use switch in a program?

847