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