Data Structure Operations
Before choosing a particular data structure we must be aware about how easy it will be to operate on it.
After all, we are not just going to store the data. We will retrieve it, insert new data, delete and so on.
The data structure to be used must be capable of all these activities.
A good data structure must be able to provide atleast following operations:
We may need to access each element stored in data structure for certain purpose.This activity is referred to as traversal operation.
Traversal indicates iterating over each element starting from beginningto the end or vice-versa.
We may need to find a particular element from the data structure which satisfy the required search criteria. This activity is referred to as search operation.
During search operation, we traverse through all elements and check the element at various index to find the matching element.
We may need to insert new element in the data structure. This activity is referred to as insert operation.
When we create a data structure, say array, we do so to store some data in it. This is possible using insertion operation.
We may need to delete certain elements from the data structure if it is no longer required. This activity is referred to as delete operation.
We may need to combine data of different files into a single file. This activity is referred to as merging.
We may need to sort data in certain order, say in increasing order or alphabetically. This is referred to as sorting.
A good data structure would be well equipped to provide facility for all the above operations