ATA Tructures: Atch Hursday Anuary Ssignments ODE Otes
ATA Tructures: Atch Hursday Anuary Ssignments ODE Otes
BATCH B
ASSIGNMENTS 2
NOTES:
1) Please carefully read all assignments and there is no choice.
2) Each problem in this assignment has to be answered in the same c file.
3) Create a .c file following the file name convention:
If your roll number is abc and assignment code is: assign02
Then use the following file name convention as follows: abc-assign02.c
For example, if the roll number is 92 and assignment code is assign02, then
the file name should be 092-assign02.c
4) Strictly follow the file name convention.
5) Do not use scanf() or do not use unnecessary print statement. Just print only
those you are asked to do in each assignment.
---------------------PROBLEMS [Total Marks: 25]:
Consider the following 6 x 9 matrix:
2
16
12
1) [Marks: 2 marks]
Read the matrix and print the transpose of the matrix
2) [Marks: 6 marks]
Symmetric: A square matrix A = [aij] is symmetric if aij = aji for all i and j
with 1 i n and 1 j n
From the given matrix:
a) Identify the symmetric matrix of size 3 and print the same.
b) Print the transpose of this symmetric matrix.
3) [Marks: 5]
Write a program to count the number of paths (> 4) in the 2-d matrix between
any x x such that each path is to be made up of a pass through an odd and
an even number alternatively from x to x and each step is a move one unit to
the right or a move one unit downward. (No moves to the left or upward are
allowed). Also print the elements on the path (space separated).
4) [Marks: 4]
Identify any two columns in such a way that the element of one column is
simply twice the value of elements of the second column.
5) [Marks: 5]
Find two rows in such a way that the sum of first row would be a mirror image
of the sum of the second row. For example, if the sum of the first row is 12
then the sum of the second row should be 21.
Now
a) Print these two rows
b) Print the transpose of these two rows with their sum at the end.
6) [Marks: 3]
Construct a one-zero matrix from the above matrix in such a way that the
given matrix is reduced by removing numbers other than 1 in each row and
then by adding zero to the tail of each smallest row so as to make it as a zeroone matrix.
----------------------