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

Does a derived class inherit or doesn't inherit?

1037


How are the features of c++ different from c?

1015


What is a flag in c++?

1009


What is c++ runtime?

1048


How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?

1220


Which format specifier is used for printing a pointer value?

1006


what is C++ exceptional handling?

1091


the maximum length of a character constant can be a) 2 b) 1 c) 8

1041


What is a string example?

1013


What is the difference between public, private, and protected access?

1010


What are the operators in c++?

1055


What is binary object model?

966


What is setbase c++?

1051


Explain the benefits of proper inheritance.

1081


What do you mean by volatile and mutable keywords used in c++?

925