Problem statement in linear arrays


Q1. Consider a polynomial p(x, y, z) as:

p(x, y, z) = 8x2y2z – 6yz8+ 3x3yz + 2xy7z – 5x2y3 – 4xy7z3

a) Re-write the polynomial so that the terms are in ordered form.

b) Assume that the terms are stored in the order shown in the problem statement in linear arrays COEF, XEXP, YEXP, and ZEXP with the HEAD node first.

Assign values to the LINK so that the linked list comprises the ordered sequence of terms.

Q2. Write down an algorithm for determining solution to Tower’s of Hanoi problem. Describe the working of algorithm for the 4 disks.

Q3. Consider the given arithmetic infix expression Q.

Q = A + (B * C – (D / E ↑ F) * G) * H

Transform the infix expression Q to equivalent post expression by using the stack.

Q4. Write down an algorithm for Binary Search method. Apply the algorithm on an ordered array A with the given elements {11, 22,

30, 33, 40, 44, 55, 60, 66, 77, 80, 88, 99}. Find out the number of key comparisons made while searching for the keys 40 and 85.

Q5. Define the term Sorting? Write down an algorithm for Insertion Sorting method. Apply the algorithm to sort out the elements:

25, 15, 30, 9, 99, 20, 26

Q6. Write down a recursive function to print the reverse of the string passed to it as the argument.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Problem statement in linear arrays
Reference No:- TGS011153

Expected delivery within 24 Hours