What is Data Structure
The data structure name indicates itself that organized the data in memory.
A data structure can be specifies as a batch or group of the data elements which provides an effective way of data storing and data organizing in the computer so data structure can be used proficiency.
It plays an important role in enhancing the performance of the software or program as the main function of the software is to store and receive user data as fast as possible.
There are many ways of organized the data in the memory as we have already seen one of the data structures, i.e., array in C++ language.
There are also another ways to organized the data in memory. Let's look the different types of data structures.
Data Structures is a set of algorithms that we can use in any programming language to structure the data in the memory location. These abstract data type are the set of rules.
Major Operations of Data Structure
Major or Common operations that can be performed on the data structures are:
- Searching: you can search for any element in a data structure.
- Sorting: you can sort the elements of a data structure either in an ascending or descending order.
- Insertion: you can also insert the new element in a data structure.
- Merging: When two lists form a list A and B list of similar types of elements of size A of M and N, respectively, the third list is involved in the creation of list C (size + M + N), this process is called merging.
- Traversing: Every data structure has a set of data elements. Moving on to each element of the data structure to perform some specific operation, such as searching or sorting, means visiting each element of the data structure.
Basic Terminology of Data Structure
Data structures are the building blocks of any program or software. Terminology is used as far as data structures are concerned.
- Data : Data can be defined as a primary value or a collection of values, for example, the student's name and its ID are data about the student.
- Data Items : The data items which are subordinate data items are called group items. For example student can have a first name and the last name.
- Records : For example, it can be defined as a collection of different data objects, for example, if we talk about a student unit, its name, address, syllabus and digits together to create a record of the student Can be grouped.
- Files : A file is a collection of different records of a type of entity, for example, if there are 60 employees in a class, the corresponding file will contain 20 records where each record contains data about each employee.
- Attributes and Entity : An entity represents a class of certain objects. It has various characteristics. Each attribute represents the special property of that entity.
- Field : A field is a single primary unit of information representing an entity's attribute.
Types of Data Structure
- Primitive data structure
- Non-primitive data structure
Need of Data Structures
As applications are becoming more complex and the amount of data is increasing day by day, the following problems can occur:
- Processor speed: To handle very large sizes of data, high-speed processing is required, but as data is growing into billions of files per day, processors may fail to deal with that amount of data.
- Data Search: Consider a list size of 106 items in a store, if our application needs to search for a particular item, it needs to traverse 106 items each time, resulting in a slower search process.
To solve the above problems, data structures are used. The data is organized to create a data structure in such a way that not all the objects need to be searched and the required data can be searched immediately.
Which Data Structure?
which in terms of both the space and times. For example, Stack is an ADT (stand for Abstract Data Type) that uses either arrays or linked list data structures for the execution. Thus, we wind up that we require some data structure to implement a specific ADT.
An ADT informs what is to be done and data structure informs how it is to be done. In other words, we can say that ADT gives us the layout while data structure provides the implementation part. Now the question appear: how can one get to know which data structure to be used for a specific ADT?.
For example, the Stack ADT can be executed by both Arrays and linked list.
Advantages of Data structures
There are following advantages of a data structure
- Efficiency : If the choice of a data structure for implementing a particular ADT is actual, it makes the program very efficient in terms of time and space.
0 Comments