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

How do you initialize a string in c++?

557


What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

647


Explain the properties and principles of oop.

526


Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.

626


What are the advantages of using friend classes?

621






What do you mean by inheritance in c++?

597


What is size_type?

545


Evaluate !(1&&1||1&&0) a) Error b) False c) True

700


Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?

1733


How is c++ used in the real world?

568


What is the difference between a pointer and a link in c ++?

560


What is the use of seekg in c++?

594


What is std :: flush?

571


Can a class be static in c++?

563


What problems might the following macro bring to the application?

616