Generalized data structures and algorithms

Source: Internet
Author: User
Document directory
  • Data Structure
  • Algorithm
  • Data structures and algorithms embodied in programming languages
  • ERP
Narrow data structures and algorithms

In the past, when I was studying at school, the teacher stressed that the most important thing to learn programming is to learn data structures and algorithms. Of course, the operating system principles and computer composition principles are equally important. after graduation, many people found that data structures and algorithms were almost useless during programming, so they thought that these teachers were all confused?

Data Structure

When it comes to data structures, we think of arrays, stacks, queues, linked lists, trees, and graphs ), heap, hash ). at school, we spent a lot of time learning how to implement these data structures. in the work, many programming languages have class libraries to help you achieve this. You can simply use them to get a general idea of the Principles and usage of various data structures. maybe the most we use is array.

Algorithm

Data structures may still be used occasionally, but few algorithms have been used. when you think of algorithms, you will immediately think of various sorting algorithms, such as bubble, selection, insertion, and merge sorting. then there is a search algorithm.

There may be more opportunities for underlying development to use data structures and algorithms. however, most application software is rarely used directly, and most of the software industry in China is engaged in application software development. the data structure can be directly called in the class library, and the Sorting Algorithm is simpler. It is possible to call an sort function to sort the data. if all the massive data is stored in the database, you can use SQL to solve the problem. You do not need to worry about the data structure and algorithms. in the process of application software development, you may be more familiar with business processes and familiar with some syntax details of programming languages. A language like C # requires you to be familiar with various controls.

Therefore, the narrow data structure is not very useful for some people who use advanced programming languages to develop application software. but it may be particularly useful for developing operating systems, databases, compilers, and search engines.

Generalized data structures and algorithms

 

Data structures and algorithms embodied in programming languages

Generalized Data Structure

Generally, in the data structure, we call the structure types such as integer, floating point, and complex type as basic types, and then combine these basic types into arrays and trees through some logic, the figure shows a common data structure. in fact, we can also regard the 01 type that the machine can recognize as the basic type, so the integer, floating point, and complex types can all be regarded as a data structure. the basic types are combined into struct, and the basic types and functions are combined into classes ). each struct class can also be viewed as a data structure.

We all know that we are now the so-called information society, and data is the carrier of information. therefore, a software system processes information and data. classifies, stores, computes, and transfers data. A database is a dedicated organization that stores data. the role of the entire Internet is data transmission. encryption and decryption technologies are available for data confidentiality, and various TPC/IP protocols are available for unified data parsing specifications. all websites send data to you, text, images, videos, and so everything on the computer is data. in the past, bidaras believed that the world was composed of numbers, and everything was digital. in the computer world, everything is actually measured in numbers and various types of data. of course, sometimes we need to convert numbers into analog signals like sound images.

Everything in the computer is centered around the data, so the programming language is even more so. take the C language in the process-oriented language as an example. first, we need to define data structures such as integer, floating point, struct, struct, enumeration, and arrays to store data. Of course, data occupies a part of the memory during running. if it is managed by the system in the stack, you don't have to worry too much. if you store data in the heap to use the memory flexibly, you must use pointer pointing. these can be understood as generalized data structures.

Generalized Algorithm

When there is data, we need to operate on it. First, we need to use arithmetic expressions such as addition, subtraction, multiplication, division, and so on, and then what is greater than or less than, or such logical expressions, and there are also various assignments. these expressions are combined with sentences and statement blocks. we generally use functions to encapsulate them together. all the expressions, statements, and functions that operate on data can be considered as generalized algorithms. in fact, a lot of complex algorithms are written in programming languages, just a few simple basic data types, and then a string is added to make your first big for, while, if, else combination. what macros, const, and function pointers are used to operate data conveniently and correctly. it is estimated that the design of MFC is used to create an extreme realm by using macros. A pile of macros are really scary.

Therefore, in C speech, data types (data structures) are basically defined, and then operations are performed using various functions (algorithms). To put it bluntly, the generalized data structure and algorithm are added.

Object-oriented languages, such as C ++, have little difference. The most important thing is the emergence of the concept of classes. we can regard the class as a special data structure. it contains data and functions. maybe the most difficult thing about object-oriented language is how to design classes one by one. how can we design various classes as an artistic activity? How can you create a mathematical model for your real business. encapsulation, inheritance, and Polymorphism of classes. encapsulation is easy to change, hiding information that is irrelevant to class users, and making changes do not affect other classes easily. second, reduce the possibility of making mistakes. A lot of data is not available for you. inheritance is mainly to make full use of existing data and avoid repeated data construction. polymorphism makes data operations more flexible and convenient. c ++ also has the concept of generic programming, which can be seen as a special polymorphism. when writing a function, in order to be generic to all data types, the concept of generic is introduced to avoid paying attention to a specific type. it is like a good template. When you call it, you can upload a real type to OK. generic programming is also C #
2.0 most important concepts. the most important concept in C #3.0 is LINQ. It is also used to facilitate data operations. It can be used to operate all data sets, such as XML, database, and array, just like SQL.

All object-oriented languages still define data and use functions to process it. in the end, it is still a generalized data structure plus algorithm. it is not as obvious as dividing data and functions in the process-oriented process. in the closer integration of Object-oriented Data and functions, data and functions are combined to form a class, and then the class can be regarded as a data, and a class can be combined with some functions.

Data structures and algorithms in applications

When we stare at data and functions, we tend to think about the problem from the computer perspective. we know that a very powerful skill of people is to abstract and hide the internal implementation details of some complicated things. The specific implementation in it is the responsibility of others, we only need to know the interface. for example, we use cars, cell phones, TVs, washing machines, etc. as long as it will be used. the operating system abstracts a lot of hardware details. therefore, most people use computers. Just click the graphical interface with the mouse. naturally, we can further encapsulate data, functions, and classes in programming languages. for example, if the share point of Microsoft is used, the entire website can be accessed by just a few clicks, but I have never used share.
Point. I just heard about it. I don't know if it works well. there are also new type companies with similar products. I have been playing this game. It's very interesting. After a few hours of getting familiar with it, I can go through the complex website. in C #, you can drag some widgets into the form of web pages, you only need to set some parameters. however, this is too inflexible and has poor maintainability. If something goes wrong, you cannot debug it. It is difficult to find out what went wrong. therefore, the data structure is not a simple data or class, but a page, and the algorithm is how to set parameters step by step.

In fact, it is necessary to say that all a series of actions and practices can be regarded as algorithms in a broad sense. it can include humans. at the beginning, I said that many people think it is important to be familiar with business processes. in fact, we can regard a system business process as an algorithm.

In addition, we may only think that developers will deal with data structures and algorithms. In fact, users will also deal with them. we use data structures and algorithms to allow computers to do things for us and follow our requirements step by step. when a user uses an application, he also wants the program to do something for him. In this case, the user only sees the application. The program encapsulates and hides the operations of the computer. the data structure and algorithm are simpler. for example, if you are playing QQ, you may be friends one by one, just like a data structure, and the algorithm is just a click. the complexity is like the ERP system, where tables are like data structures, such as order tables, sales tables, fund flow statements, and balance sheets. the algorithm is to operate according to the actual business process.

In fact, software is just a tool. If you can do a good job of this tool, it will make a lot of money to provide users with great convenience, rather than necessarily say how much technology is used to call a powerful software. the most profitable software may be the operating system, database, and ERP software. for Windows like Microsoft, many people say that it is not good. It may not be as good as Unix or Linux at the technical level. however, it is easy to use and makes it easy for ordinary people to operate their computers, so everyone is willing to pay for it. there is also office, and the technical content is not necessarily high, but it brings great convenience to many people's work, so it also sells money. windows and Office are two of Microsoft's most profitable products. the database is like oralce, and it makes a lot of people jealous. because modern times are information society, and data is the carrier of information, data needs to be managed in all industries and databases are naturally used.

ERP

In addition, ERP also makes money. oralce also makes ERP, but there is also a German company SAP, which is more powerful than ERP, it can sell tens of millions of ERP systems with more services. why is ERP important? Because it wants to move all the businesses in all industries to the computer. the most obvious advantage is that it is not fully customized based on your business. ERP is based on some excellent management solutions and processes in that line, and then you use the same advanced management methods. naturally, you need to be compatible with some of your previous businesses and cannot completely change your own business. because ERP has a high configuration, it can be flexibly applied to all walks of life. what is high configuration. here is a simple example. for example, you can create your company architecture in it. For example, the company is a group and there are many companies in the group. Each company has procurement, sales, finance, and other departments, some departments may span several companies. after the configuration is complete, many subsequent operations will follow these configurations. this is like a template in C ++, like generic programming. When you use it, upload some specific types. the configuration information of ERP is equivalent to some specific types. so the same ERP system can be used in all walks of life, as long as you do different configuration. we can regard this as a higher-level application of generic programming. of course, the system is complicated and lacks flexibility, so if you don't integrate all kinds of systems and use ERP together, the sentence will be fulfilled. If you don't use ERP, it's just waiting, when ERP is used, it is an emergency. in addition, sap has a dedicated programming language ABAP for secondary development of its ERP. this can be seen as a larger configuration change.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.