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 / santosh patil
just copy elements from 5th to 4th den 6th to 5th n so
on.....at last delete the last node r set it to null
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is c++ free?
Explain the term memory alignment?
Where is atoi defined?
What are the three forms of cin.get() and what are their differences?
Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement
What are iterators in c++?
What are the storage qualifiers?
How does c++ structure differ from c++ class?
What is c++ runtime?
How to allocate memory dynamically for a reference?
What is void pointer in c++ with example?
Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. Your program should work for squares of all side sizes between 1 and 20. --- │ │ │ │ │ │ ---
What is flag in computer?
What are the comments in c++?
Why is polymorphism useful?