The basic data type is predefined by the C + + compilation system, and the data for the custom type is made up of multiple primitive types or elements of a custom type, which we call group data.
For group data, only system-predefined operations are not enough, and in many cases it is necessary to design special operations related to specific problems, and to encapsulate data and operations in an object-oriented way, which is a group class .
Groups can be divided into two types: linear and nonlinear groups. Elements in a linear group are ordered by position. Non-linear populations identify elements without positional order.
The organization of group data belongs to the data structure category, here only two kinds of commonly used algorithms: sorting and finding methods.
Sorting: Also known as classification or collation, is the process of adjusting an unordered sequence to an orderly one. There are two basic operations that need to be done during sorting: one is to compare the size of two numbers, but to adjust the position of the elements in the sequence. Sort by: Direct insert sort, direct select sort and bubble sort.
Find: Is the process of finding the specific data element that is needed in a sequence in a certain way. Methods: Sequential lookup, binary lookup.
1.
7. Organization of Group and group data-1. function templates and class templates