Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

1) copy content of element 5 to element 4
2) link element 4(which already contains number 5) to
element 6
3) delete element 5

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In what situations do you have to use initialization list rather than assignment in constructors?

1060


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

1000


What is encapsulation in c++?

1289


What is a local variable?

1082


Explain the advantages of using friend classes.

1160


What is constructor c++?

1115


What is the use of lambda in c++?

1020


Is java based off c++?

968


What are the differences between malloc() and calloc()?

1179


what is Member Functions in Classes?

1194


explain the reference variable in c++?

1062


What is difference between array and vector in c++?

1029


Write about the use of the virtual destructor?

1005


What are disadvantages of pointers?

1036


What is scope operator in c++?

1080