0% found this document useful (0 votes)
402 views

DSA Assignment

The document contains 4 assignments related to data structures and algorithms for different student groups. The assignments cover topics such as: 1. Differences between structures and unions, array operations including insertion and deletion. 2. Representing a 2D array in memory and finding the address of a specific element. 3. Implementing postfix expression evaluation, infix to postfix conversion, and polynomial operations. 4. Sparse matrix representations and operations like transpose, dynamic memory allocation functions. 5. Stack implementations and operations like evaluation of postfix expressions.

Uploaded by

Aman Singh
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)
402 views

DSA Assignment

The document contains 4 assignments related to data structures and algorithms for different student groups. The assignments cover topics such as: 1. Differences between structures and unions, array operations including insertion and deletion. 2. Representing a 2D array in memory and finding the address of a specific element. 3. Implementing postfix expression evaluation, infix to postfix conversion, and polynomial operations. 4. Sparse matrix representations and operations like transpose, dynamic memory allocation functions. 5. Stack implementations and operations like evaluation of postfix expressions.

Uploaded by

Aman Singh
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
You are on page 1/ 2

DON BOSCO INSTITUTE OF TECHNOLOGY

Kumbalagodu, Bangalore-560074

DEPARTMENT OF INFORMATION SCIENCE & ENGINEERING


Subject: DATA STRUCTURES AND APPLICATIONS Sub Code: 18CS32

ASSIGNMENT – 1

Group – 1

1. Differentiate between Structures and Union (Mention at least 5 differences).


2. Explain with example and tracing i) Insertion and ii) Deletion in an array.
3. Suppose each student in a class of 25 students is given 4 tests, assume the students are
numbered from 1 to 25, and the test scores are assigned in the 25 X 4 matrix called SCORE.
Suppose Base (SCORE) = 200, w=4 and the programming language uses row-major order to store
this 2D array, then find the address of 3rd test of 12th student i.e. SCORE (12, 3).
4. Write the postfix form of the following expression using stack method.
a. (a + b) * d + e / ( f + a * d ) + c
b. ((a/ (b – c + d)) * (e – a) * c)
5. Write a program to implement PATTERN MATCHING Algorithm.

Group – 2

1. What is sparse matrix and show with a suitable example for sparse matrix representation storing
as triples. Give a sample function to read sparse matrix.
2. Write an algorithm to evaluate a postfix expression. Evaluate the following postfix expression
ABC + * D E / - where A=5, B=6, C=2, D=12 and E=4.
3. Write a program to convert given infix to postfix expression.
4. Write a program to implement ARRAY Operations.
5. Write a function to transpose the given sparse matrix. Express the given sparse matrix as triplets
and find its transpose.

10 0 0 25 0
0 23 0 0 45
A= 0 0 0 0 32
42 0 0 31 0
0 0 0 0 0
0 0 30 0 0
Group – 3

1. List and explain any 4 functions supported in C for dynamic memory allocation with examples.
2. Consider 2 polynomials A(X) = 2X1000 + 1 and B(X) = X4 + 10X3 + 3X2 + 1 with a diagram show how
these polynomials are stored in 1D array.
3. Write a function to evaluate a postfix expression and trace the same for the expression
A B / C – D E * + A C * where A = 6, B=3, C=1, D=2 and E=4.
4. Write a program to implement STACK Operations.
5. Explain how two dimensional arrays are represented in memory with an example.

Group – 4

1. What is a polynomial? What is the degree of the polynomial? Write a function to add two
polynomials.
2. Write a C Program to demonstrate the various stack operations, including cases for overflow
and underflow of STACKS.
3. Write the post fix form of the following expression.
a. ((6 + (3-2)*4^5+7)
b. A $ B $ C * D
4. Write a program to implement a stack using dynamic array whose initial capacity is 1 and
implement the operations push, pop and display.
5. Write a program in C for evaluation postfix expression.

You might also like