Skip to main content

Basics of Data Structure

 

Basic Operations of Data Structures

In the following section, we will discuss the different types of operations that we can perform to manipulate data in every data structure:

  1. Traversal: Traversing a data structure means accessing each data element exactly once so it can be administered. For example, traversing is required while printing the names of all the employees in a department.
  2. Search: Search is another data structure operation that means to find the location of one or more data elements that meet certain constraints. Such a data element may or may not be present in the given set of data elements. For example, we can use the search operation to find the names of all the employees who have the experience of more than 5 years.
  3. Insertion: Insertion means inserting or adding new data elements to the collection. For example, we can use the insertion operation to add the details of a new employee the company has recently hired.
  4. Deletion: Deletion means to remove or delete a specific data element from the given list of data elements. For example, we can use the deleting operation to delete the name of an employee who has left the job.
  5. Sorting: Sorting means arranging the data elements in either Ascending or Descending order depending on the type of application. For example, we can use the sorting operation to arrange the names of employees in a department in alphabetical order or estimate the top three performers of the month by arranging the performance of the employees in descending order and extracting the details of the top three.
  6. Merge: Merge means combining data elements of two sorted lists in order to form a single list of sorted data elements.
  7. Create: Create is an operation used to reserve memory for the data elements of the program. We can perform this operation using a declaration statement. The creation of data structure can take place either during the following:
    1. Compile-time
    2. Run-time
      For example, the malloc() function is used in C Language to create data structure.
  8. Selection: Selection means selecting a particular data from the available data. We can select any particular data by specifying conditions inside the loop.
  9. Update: The Update operation allows us to update or modify the data in the data structure. We can also update any particular data by specifying some conditions inside the loop, like the Selection operation.
  10. Splitting: The Splitting operation allows us to divide data into various subparts decreasing the overall process completion time.

Understanding the Abstract Data Type

As per the National Institute of Standards and Technology (NIST), a data structure is an arrangement of information, generally in the memory, for better algorithm efficiency. Data Structures include linked lists, stacks, queues, trees, and dictionaries. They could also be a theoretical entity, like the name and address of a person.

From the definition mentioned above, we can conclude that the operations in data structure include:

  1. A high level of abstraction like the addition or deletion of an item from a list.
  2. Searching and sorting an item in a list.
  3. Accessing the highest priority item in a list.

Whenever the data structure does such operations, it is known as an Abstract Data Type (ADT).

We can define it as a set of data elements along with the operations on the data. The term "abstract" refers to the fact that the data and the fundamental operations defined on it are being studied independently of their implementation. It includes what we can do with the data, not how we can do it.

An ADI implementation contains a storage structure in order to store the data elements and algorithms for fundamental operation. All the data structures, like an array, linked list, queue, stack, etc., are examples of ADT.

Understanding the Advantages of using ADTs

In the real world, programs evolve as a consequence of new constraints or requirements, so modifying a program generally requires a change in one or multiple data structures. For example, suppose we want to insert a new field into an employee's record to keep track of more details about each employee. In that case, we can improve the efficiency of the program by replacing an Array with a Linked structure. In such a situation, rewriting every procedure that utilizes the modified structure is unsuitable. Hence, a better alternative is to separate a data structure from its implementation information. This is the principle behind the usage of Abstract Data Types (ADT).

Some Applications of Data Structures

The following are some applications of Data Structures:

  1. Data Structures help in the organization of data in a computer's memory.
  2. Data Structures also help in representing the information in databases.
  3. Data Structures allows the implementation of algorithms to search through data (For example, search engine).
  4. We can use the Data Structures to implement the algorithms to manipulate data (For example, word processors).
  5. We can also implement the algorithms to analyze data using Data Structures (For example, data miners).
  6. Data Structures support algorithms to generate the data (For example, a random number generator).
  7. Data Structures also support algorithms to compress and decompress the data (For example, a zip utility).
  8. We can also use Data Structures to implement algorithms to encrypt and decrypt the data (For example, a security system).
  9. With the help of Data Structures, we can build software that can manage files and directories (For example, a file manager).
  10. We can also develop software that can render graphics using Data Structures. (For example, a web browser or 3D rendering software).

Apart from those, as mentioned earlier, there are many other applications of Data Structures that can help us build any desired software.

Comments

Popular posts from this blog

Service install on window system

 If we have to install service make sure,  .interframework install already. Goto folder like:-  C:\Windows\Microsoft.NET\Framework\v2.0.50727  C:\Windows\Microsoft.NET\Framework\ v2.0.50727 (Note: version folder can be change as the version change.) Open command prompt by  writing the "cmd" in the box of file/folder location shoes Run the command : "installUtil.exe pathofexeofthe service"

7 features of OOPs

The 7 features of OOPs are as follows: 1. Incapsulation 2. Abstraction 3. Inheritance 4. Polymorphism 5. Object must be used 6. Massage passing : One object can interect with another object 7. Dynamic binding The most initial 4 are the basic OOPs features that is required.