Data Structure
- Data Structure is an organized collection of data.
- A data structure is a structured set of variables associated with one another in different ways.
- The mathematical or logical model used to organize the data in main memory, is called a data structure.
- There are various types of data Structure.
- Linear Data Structure:- A data structure in which its elements form a sequence. It means each element in the linear data structure has a unique predecessor and a unique successor. Example: Array, Stack, Queue, Linked list
- Non-linear Data Structure:– A data structure in which elements don’t form a sequence. It means unlike linear data structure, each element doesn’t have a unique predecessor and unique successor. Example: Tree, Graph, Tables, Sets
Operation on Data Structure
Different data structures allow different types of operations. Various operations that can be performed on data structures are:
- Insertion:- Adding a new element in the data structure.
- Deletion:- Removing any existing element from the data structure.
- Traversing:- Accessing all of data elements one by one to process all or some of them.
- Searching:– Process of finding the location of a particular element in the data structure.
- Sorting:– Process of arranging all the elements in some logical order. The order may be as Ascending or Descending or Alphabetic.
- Merging:– Combining the data structure into a single data structure.