Dynamic Inserting and Deleting

Which data structure is used for inserting and deleting dynamically?

Questions by sachin007

Showing Answers 1 - 6 of 6 Answers

stealth

  • Mar 2nd, 2010
 

Dynamic insertion and deletion works well with Lists (like a doubly linked list)
(also mentioned in the previous answer)

The problem gets incremented this way;

Insertion at a particular location; should be started first with a search for the the right location.
Deletion of a particular element; should similarly be first started off with a search for the entry.
So; if insertion/deletion are specific, the order of the search for the right location and position gets added to the process.
Therefore; if the order of search comes in, the choice of data structure would change.
You could have a linked list or a hash table or a b-tree or a tree.

So if lists, doubly linked list is the best data structure for insertion/deletion? then No! it depends upon the situation and problem at hand.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions