---------------------------------------------the second--------the first section------more data about how to store problems

Source: Internet
Author: User

The linear structure, the linear structure, is the most basic and simplest type of structure in the data structure, and the typical linear table

Linear table: Give a column

The following is a unary polynomial f (x) =a0+a1*x+a2*x+~~~~~~~+an*x;

Ask you to think about and give a few ways you can think of storage.

1: Use an array to store its coefficients, then add them together with a for loop.

------Disadvantage is 1: time complexity is relatively high, the machine did a lot of useless, for example, when the unary polynomial is 2*x+3*x^2000. This makes a lot of useless work----------------------the following is an optimization algorithm for this situation---------------

2: Using a structure array only the coefficients and the sub-square are not zero of the storage to calculate this saves a lot of time and space-shaped like

struct Polynode *struct  polynode{    int coed;       int expon;       polynomial ilnk;  //}

----------------------the same problem has different storage methods-----storage methods and algorithms are closely related-----------------------------

The simplest storage method in the data structure is the two 1: Array 2: Linked list.

======================= I'm a big delimiter ================================   

What is a linear table?

Linear table: A linear structure of ordered sequences consisting of data elements of the same type.

---------------------------------------------the second--------the first section------more data about how to store problems

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.