Adobe Interview Question
Computer ScientistsCan be done using array.
1. Determine the maximum degree out of the provided polynomials.
2. Make the array/arraylist of that size.
3. a[0] represents the constant and a[2] represents the x^2 coefficient.
4. Add the same index values of both arrays in the third array.
Complexity: O(n)+O(m)
Correct me if I am wrong in the complexity.. Just started DAA,, so still learning.
LinkedList will be a good option.
- TestDoc June 20, 2011Node will contain multiplir, variable and a power.