What is Data Structure?

Data structure is a way of storing, organized and systematic data organization so that data can be used effectively.

Here are two fundamental concepts that form a data structure:

Interface : Each data structure has an Interface. The interface represents a set of calculations that a data structure supports. An Interface provides only a list of supported calculations, the types of parameters they can accept and the return type of these operations.

Implementation (can be understood as implementation) : Provides internal representation of a data structure. Implementation also provides a definition of the algorithm used in data structure calculations.

Characteristics of a Data Structure

Exactly : The implementation of the Data Structure should implement its Interface correctly.

Time complexity (Time Complexity) : Runtime or execution time of data structure calculations must be as small as possible.

Memory complexity (Space Complexity) : The memory usage of each calculation of the data structure should be as small as possible.

Why is data structure necessary?

Today, applications are increasingly complex and the amount of data is growing with a variety of types. This presents three major problems that every developer faces:

Searching for data : Suppose there are 1 million goods stored in stock. And suppose there is an application needed to search for a goods. Every time I do a search, this app will have to search for 1 item in 1 million goods. As the data increases, the search will become more and more slow and expensive.

Processor speed : Although the processor has a very high speed, it is also limited and when the amount of data is up to billions of records, the processing speed will no longer be fast.

Multiple requirements : When thousands of users perform a search operation on a Web Server, no matter how fast the Web Server is, it is really difficult to handle thousands of calculations at once.

To handle the above problems, data structures are a great solution. Data can be organized in a data structure in such a way that when a search of an element is performed, the requested data is immediately found.

Implementation time complexity in data structures and algorithms

There are 3 cases that are often used to compare the execution time of different data structures:

Worst case (Worst Case) : is a situation where a calculation of certain data structures takes maximum time (the longest time). For example, with three numbers 1, 2, 3, if sorted in descending order, the execution time will be the longest (and this is the worst case); if sorted in ascending order, execution time will be the shortest (and this is the best case).

Average Case : describes the average execution time of a calculation of a data structure.

Best Case : A situation where the execution time of a calculation of a data structure is the least. Example as above.

Basic terminology in Data Structures

Data : Data are values ​​or a set of values.

Data element : Data element is a single unit of value.

Group elements : Data elements that are divided into sub-elements are called group elements.

Basic elements : Data elements that cannot be subdivided into child elements are called basic elements.

Attributes and Entities : An entity is something that contains certain attributes, and these attributes can be assigned values.

Entity aggregation : Entities that have similar attributes constitute an entity set.

Field : A field is a basic information unit representing an attribute of an entity.

Record : A record is a set of field values ​​of a given entity.

File : A collection of records of entities in a given entity set.

According to Tutorialspoint

Previous article: Web programming in C ++

Next lesson: Setting environment in Data structure

4 ★ | 1 Vote

May be interested

  • How to implement a graph data structure in GolangHow to implement a graph data structure in Golang
    charts are one of the essential data structures that you must know as a programmer. let's learn how to create graph/graph data structures in golang !
  • Search algorithm by widthSearch algorithm by width
    the breadth search algorithm (breadth first search - bfs for short) walks through a wide graph and uses a queue to memorize adjacent vertices to start the search when no peak is found. adjacent in any loop.
  • How to Implement a Stack Data Structure in C++How to Implement a Stack Data Structure in C++
    a stack is a basic data structure that is commonly used throughout computer science. for example, a stack is utilized by your web browser to remember the last few pages you were on. developers and programmers should be very familiar with...
  • What is Silo Structure? Advantages and disadvantages of silos and effective alternativesWhat is Silo Structure? Advantages and disadvantages of silos and effective alternatives
    everyone knows that a properly structured website is good for both users and seo. silo structure is one of many ways that seo experts recommend people to apply for their website.
  • Deep search algorithmDeep search algorithm
    deep search algorithms (depth first search - dfs for short), also called depth-first search algorithms, are algorithms that browse or search on a tree or graph and use the stack ( stack) to remember adjacent vertices to start the search when the adjacent vertex is not encountered in any loop.
  • Environment settings in Data structuresEnvironment settings in Data structures
    because c and c ++ languages ​​are the languages ​​that almost every university uses to teach, in this chapter i will guide you to install c and c ++ to run the examples in the configuration series. structure and algorithm.
  • What is URL? Structure of the URLWhat is URL? Structure of the URL
    what exactly is a url, what is its structure and composition? this article will give you an overview of urls and its structure.
  • New achievement: TSP chip structure can run 1 million billion operations per secondNew achievement: TSP chip structure can run 1 million billion operations per second
    chips with the tsp structure of startup groq can perform up to 1 peta task per second, that is, 1,000,000,000,000,000 actions per second.
  • Types of data center designTypes of data center design
    it professionals always have to learn, apply new ways to design the data center structure to get efficiency, ensure large capacity and easily expand without any trouble.
  • AVL tree in data structure and algorithmAVL tree in data structure and algorithm
    what happens if the data entered into the binary search tree (bst) is in ordered form (ascending or descending). it will look like the following.