Techniques of representing polynomials using arrays, Data Structure & Algorithms

Q. Explain any three methods or techniques of representing polynomials using arrays. Write which method is most efficient or effective for representing the following polynomials.

 

8x100+10x+6

8x3-7x2+5x+15

 

Ans.

The three methods or techniques of representing polynomials using arrays is given as follows

(1) if maximum value of exponent of a polynomial is m then describe an array of size m+1 and store coefficient in corresponding index position or location as exponent. Ex:

2x2 +1 is stored as

829_array.png

(2) The one-dimensional  array  is  used  to  store  exponent  and  coefficient alternatively. Ex: 2x2 +1 is stored as

2005_array1.png

The  size  of  array  needed  is  2*n  where  n  is  the  number  of  elements  in

polynomial.

(3) Use  two dimensional arrays  or  one-dimensional  array  of  structures  one  for  storing exponents and other for co-efficient.

Ex: 2x2 +1 is stored as

525_array2.png

The size of arrays is 2*n where n is the number of the elements in polynomial. (i)  The second and third methods or techniques are the efficient methods.

For saving 8x100+10x+6  , as in method 1 there is a requirement of 101 integer locations.

(ii) 8x3-7x2+5x+15 for this polynomial any one of the representations can be used, but method or technique 1 will be best as there is only coefficients required to be stored. There are no gaps in the exponents; hence the complete array will be filled with the coefficients.

Posted Date: 7/13/2012 2:37:53 AM | Location : United States







Related Discussions:- Techniques of representing polynomials using arrays, Assignment Help, Ask Question on Techniques of representing polynomials using arrays, Get Answer, Expert's Help, Techniques of representing polynomials using arrays Discussions

Write discussion on Techniques of representing polynomials using arrays
Your posts are moderated
Related Questions

Q. Explain the result of inserting the keys given. F, S, Q, K, C, L, H, T, V, W, M, R, N, P, A, B, X, Y, D, Z, E  in an order to an empty B-tree of degree-3.

Algo rithm to Insert a Node p at the End of a Linked List is explained below Step1:   [check for space] If new1= NULL output "OVERFLOW" And exit Step2:   [Allocate fr

1.  Using the traditional method of CPM: a.  What activities are on the critical path? b.  What is the expected total lead time of the project? 2.  Using CCPM: a.  What

since the gregorian calendar was introduced in 1752,a leap year occurs every 4 years.you are to write a pseudo code to find out whether a year is a leap year.your progrm should dis

Explain Optimal Binary Search Trees One of the principal application of Binary Search Tree is to execute the operation of searching. If probabilities of searching for elements

write an algorithm to insert an element at the beginning of a circular linked list?

Row Major Representation In memory the primary method of representing two-dimensional array is the row major representation. Under this representation, the primary row of the a

#question. merging 4 sorted files containing 50,10,25,15 records will take time?

Define the Internal Path Length The Internal Path Length I of an extended binary tree is explained as the sum of the lengths of the paths taken over all internal nodes- from th