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


Please Help Members By Posting Answers For Below Questions

why and when we can declar member fuction as a private in the class?

2073


What is data types c++?

1015


what is c++

2383


In the derived class, which data member of the base class are visible?

1114


What is a list c++?

1105


Explain about Virtual Function in C++?

1022


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

1056


Implement stack operations with pointers with appropriate exception checks.

976


Explain unexpected() function?

1101


What can I use instead of namespace std?

1151


What is a block in c++?

1048


What is stream and its types in c++?

1056


What is the difference between prefix and postfix versions of operator++()?

1081


What it is and how it might be called (2 methods).

1180


Is atoi safe?

1050