An array and generalized table of PART3 algorithm analysis and data structure of algorithm learning and data structure

Source: Internet
Author: User
Tags arrays

An array and generalized table of PART3 algorithm analysis and data structure of algorithm learning and data structure

1. Arrays and generalized tables can be thought of as linear tables in the following extensions: The data elements in the table are themselves also a data structure.

2, because the array is generally not inserted or delete operations, that is, once the array is established, the structure of the number of data elements and the relationship between the elements will no longer change. Therefore, it is natural to use sequential storage structures to represent arrays. Since the storage unit is a one-dimensional structure, and the array is a multidimensional structure, the data elements that hold the array in a contiguous set of storage units have an order-convention problem.

There are two ways to store a two-dimensional array: A sequence-based (column major order) storage method, which is a row-ordered primary (row major order) storage method. In the extended basic, PL/1, COBOL, Pascal, and C languages, the storage structure is dominated by the sequential sequence, whereas in Fortran, it is the storage structure with the sequence as the main order.

3, usually, in the high-level language programming, the use of a two-bit array to store matrix elements. Some programming languages also provide a variety of matrix operations, users are very convenient to use. However, in numerical analysis, some matrices with high order are often found, while there are many elements with the same value or 0 elements in the matrix. Sometimes in order to save storage space, this kind of matrix can be compressed storage . The so-called compressed storage means : allocate only one storage space for multiple values with the same value, and no space allocated to 0 Yuan .

if the value of the same element or 0 elements in the matrix distribution has a certain regularity , we call this kind of matrix is a special matrix , and conversely, called the sparse matrix .

4, Special matrix: There are N-order symmetric matrices and diagonal matrices.

Special matrix characteristics : The distribution of non-0 elements has a clear pattern, so that we can be compressed into a one-dimensional array, and find each non-0 elements in a one-dimensional array of the corresponding relationship.

5, sparse matrix features : its non-0 yuan is less than 0 yuan, and distribution does not have a certain regularity, we call it sparse matrix.

sparse factor : Suppose that in the matrix of MXN, there are t elements that are not zero. The δ=t/(mXn), called Δ, is the sparse factor of the matrix. δ<=0.05 is generally considered a sparse matrix.

6. Generalized table : As the name implies, generalized table is the generalization of linear table. It is also called a list, which is the difference between a plural form and a table list. Widely used in artificial intelligence and other fields of table processing Language Lisp language, the generalized table as the basic data structure, even the program is also expressed as a series of generalized tables. LS is the name of a generalized table (A1,a2,... an), and n is its length. In the definition of a linear table, AI (1<=i<=n) is limited to a single element. In the definition of generalized tables, AI can be either a single element or a generalized table, which is called the Atomic and Sub-table of generalized table LS respectively.

It is customary to use uppercase letters to denote the names of generalized tables and to represent atoms in lowercase letters . When the generalized table LS is not NULL, the first element is called the A1 header (head) of LS, and the table (A1,a2,... an), which is called the rest of the elements, is the footer of LS (Tail).

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.