Introduction to Data structure





What is Data Structure?

The data structure name indicates itself that organizing the info in memory. There are some ways of organizing the info within the memory as we've already seen one among the info structures, i.e., array in C language. Array may be a collection of memory elements during which data is stored sequentially, i.e., one after another. In other words, we will say that array stores the weather during a continuous manner. Data Structure organization of data is done with array of data structures. There are also other ways to organize the data in memory. Let's see the different types of data structures.

The data structure isn't any programing language like C, C++, java, etc. It is a group of algorithms that we will use in any programing language to structure the info within the memory.

To structure the data in memory, 'n' number of algo were proposed, then all these algorithms are called as Abstract data types. These abstract data types are the set of rules.


Types of Data Structures are

There are two types of data structures:

Primitive data structure

Non-primitive data structure

Primitive Data structure

The primitive data structures are primitive data types. The int, char, float, double, and pointer are the primitive data structures which will hold one value.

Non-Primitive Data structure

The non-primitive arrangement is split into two types:

Linear data structure

Non-linear data structure

Linear Data Structure

The arrangement of knowledge during a sequential manner is understood as a linear arrangement . The data structures used for this purpose are Arrays, Linked list, Stacks, and Queues. In these data structures, one element is connected to just one another element during a linear form.

When one element is connected to the 'n' number of elements referred to as a non-linear arrangement . The best example is trees and graphs. In this case, the weather are arranged during a random manner.

We will discuss the above data structures in short within the coming topics. Now, we'll see the common operations that we will perform on these data structures.

Data structures can also be classified as:

Static data structure: it's a kind of knowledge structure where the dimensions is allocated at the compile time. Therefore, the maximum size is fixed.

Dynamic data structure: it's a kind of knowledge structure where the dimensions is allocated at the run time. Therefore, the maximum size is flexible.

Major Operations

The major or the common operations which will be performed on the info structures are:

Searching: We will search for any element in a data structure.

Sorting: we will sort the weather of a knowledge structure either in an ascending or descending order.

Insertion: we will also insert the new element during a arrangement .

Updation: We can also update the element, and we can replace the element with another element.

Deletion: we will also perform the delete operation to get rid of the element from the info structure.

Which Data Structure?

A data structure may be a way of organizing the info in order that it are often used efficiently. Here, we've used the word efficiently, which in terms of both the space and time. For example, a stack is an ADT (Abstract data type) which uses either arrays or linked list arrangement for the implementation. Therefore, we conclude that we require some arrangement to implement a specific ADT.

An ADT tells what's to be done and arrangement tells how it's to be done. In other words, we can say that ADT gives us the blueprint while data structure provides the implementation part. Now the question arises: how can one get to understand which arrangement to be used for a specific ADT?.

As the different data structures are often implemented during a particular ADT, but the various implementations are compared for time and space. For example, the Stack ADT are often implemented by both Arrays and linked list. Suppose the array is providing time efficiency while the linked list is providing space efficiency, therefore the one which is that the best fitted to the present user's requirements will be selected.

Advantages of Data structures

The following are the benefits of a knowledge structure:

Efficiency: If the selection of a knowledge structure for implementing a specific ADT is proper, it makes the program very efficient in terms of your time and space.

Reusability: he data structures provide reusability means multiple client programs can use the info structure.

Abstraction: the info structure specified by an ADT also provides the extent of abstraction. The client cannot see the interior working of the info structure, so it doesn't need to worry about the implementation part. The client can only see the interface.

Post a Comment

0 Comments