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
How do you initialize a string in c++?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
Explain the properties and principles of oop.
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.
What are the advantages of using friend classes?
What do you mean by inheritance in c++?
What is size_type?
Evaluate !(1&&1||1&&0) a) Error b) False c) True
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?
How is c++ used in the real world?
What is the difference between a pointer and a link in c ++?
What is the use of seekg in c++?
What is std :: flush?
Can a class be static in c++?
What problems might the following macro bring to the application?