0% found this document useful (0 votes)
22 views2 pages

Polynomial Operations and Trees

This document discusses problems involving polynomials, binary search trees, and matrices. For polynomials, it covers creating coefficient lists, addition, subtraction, multiplication, division, and powering of polynomials. For binary search trees, it involves building a tree from a list and traversing it in ascending and descending order. For matrices, it covers operations like transposition, addition, subtraction, and multiplication of matrices as well as finding the inverse of a matrix. The problems are meant to be solved by generating the appropriate data structures and applying the relevant algorithms.

Uploaded by

Priyesh Pandey
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

Polynomial Operations and Trees

This document discusses problems involving polynomials, binary search trees, and matrices. For polynomials, it covers creating coefficient lists, addition, subtraction, multiplication, division, and powering of polynomials. For binary search trees, it involves building a tree from a list and traversing it in ascending and descending order. For matrices, it covers operations like transposition, addition, subtraction, and multiplication of matrices as well as finding the inverse of a matrix. The problems are meant to be solved by generating the appropriate data structures and applying the relevant algorithms.

Uploaded by

Priyesh Pandey
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

Data Structures through C

G V V Sharma

Problem 1. Consider the polynomials

p(x) = x + 1 (1)

q(x) = x2 + 2x + 3 (2)

1) Create a list of coefficients and the corresponding power of the variable for p(x). Note that the

coefficient of the highest power should be the first in the list.

2) Repeat the exercise for q(x).

Problem 2. Polynomial Addition and Subtraction:

1) Create the coefficient list for p(x) + q(x).

2) Repeat the exercise for q(x) p(x) and p(x) q(x).

Problem 3. Polynomial Multiplication:

1) Generate a list that gives you the coefficients of p2 (x).

2) Repeat the above exercise for q2 (x).

3) Now generate a coefficient list for pn (x). You may use the binomial theorem to generate the coeffi-

cients.

4) Using convolution, obtain the coefficient list for p(x)q(x).

*The author is with the Department of Electrical Engineering, Indian Institute of Technology, Hyderabad 502205 India e-mail:

gadepall@[Link].
2

5) Generalize the above for polynomials of any size.

6) Obtain pn (x) using convolution repeatedly.

Problem 4. Polynomial Division: Let

q(x) = p(x)g(x) + r(x), (3)

where g(x) is the quotient polynomial and r(x) is the remainder polynomial.

1) Obtain the coefficient list for g(x) and r(x).

2) Generalize this for polynomials of arbitrary sizes.

Problem 5. Binary Search Tree:

1) Enter the list of numbers

S = {3, 6, 2, 1, 5, 9, 4, 7, 0, 8} (4)

into a binary tree in such a fashion that the smaller number goes to the left brach.

2) Access this tree in such a manner as to print the numbers in ascending order.

3) Repeat the exercise to print the numbers in descending order.

4) Try to do both the above exercises using recursion.

Problem 6. Build your own tree for creating the matrix




1 1
A = (5)

1 1

1) Generate At which is the transpose of A.

2) Obtain A + At .

3) Obtain A At .

4) Obtain AAt .

5) Obtain A1 .

6) Generalize all the above operations for square and rectangular matrices of arbitrary size.

You might also like