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

What is the difference between cin.read() and cin.getline()?

825


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

852


What is decltype c++?

746


Can we get the value of ios format flags?

872


Why c++ does not have finally?

832


Explain terminate() and unexpected() function?

839


What is the main purpose of overloading operators?

816


Explain the difference between using macro and inline functions?

821


Should I learn c or c++ or c#?

760


What is the difference between reference and pointer?

853


What is the difference between C and CPP?

843


Explain how the virtual base class is different from the conventional base classes of the opps.

908


What is an adjust field format flag?

887


Why the usage of pointers in C++ is not recommended ?

1116


the first character in the variable name must be an a) special symbol b) number c) alphabet

844