Validating polynomials from a String
<p>I'm trying to make a polynomial operator (sum, rest, multiplication and division of two or more polynomials). The code must be in Java and using linked lists.</p>

<p>I was wondering how do calculators or how to validate whether a polynomial is valid or not. I want to construct a polynomial from a String, but I don't know if there is another class that can ease things.</p>

<p>This is a homework assignment so I'm not asking for complete code, just something that points me in a good direction.</p>

<p>There are two classes, one for nodes (named Monomio) and one for the list (named Polinomio, is the sum of monomials). The node class has</p>

<pre><code>Monomio siguienteMonomio; // The next monomial
int exponente; // I don't know how to say this in English, maybe power
int coeficiente; // The coefficient
// A bunch of methods, to sum, multiply etc.
</code></pre>

<p>and the list class has</p>

<pre><code>Monomio primerMonomio; //First Monomial
Monomio ultimoMonomio; //Last Monomial
// A bunch of methods, like organize the polynomial by the power, multiply, sum, etc.
</code></pre>

<p>Now I need a constructor like this.</p>

<pre><code>public Polinomio(String polinomio){
    enter code here
}
</code></pre>

<p>The user should enter something like this:</p>

<blockquote>
  <p>10x^2 - 7x + 9</p>
</blockquote>

<p>So the constructor makes a list of three nodes:</p>

<pre><code>//First node
int coeficiente = 10;
int exponente = 2;
Monomio siguienteMonomio = //secondNode

//Second node
int coeficiente = -7;
int exponente = 1;
Monomio siguienteMonomio = //thirdNode

//Third node
int coeficiente = 9;
int exponente = 0;
Monomio siguienteMonomio = null;
</code></pre>

<p>So, any ideas of how to make this? I can simply track specific characters (+ - ^ x). But that would be long and maybe there is a better way to do.</p>

<p>Sorry for my English if I have errors, I'm a Spanish speaker.</p>
