SPPU Information Technology (Semester 3)
Fundamentals of Data Structures
December 2014
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary


Answer any one question from Q1 and Q2
1 (a) Differentiate between pass by reference and pass by value.
4 M
1 (b) Explain the different modes of opening a file in C using fopen( ) function.
6 M
1 (c) What will be the output of the following code snippets?
(1) #define M(x) x * x
main( )
{
printf("%d", M(2+3))
}

(2) Main( )
{
int x;
x=4+2%-8;
printf("%d", x);
}
2 M

2 (a) What is macro? What are its advantages and disadvantages?
4 M
2 (b) Explain the use of break and continue keywords in C with suitable example.
4 M
2 (c) Write a C function to compare two strings.
4 M

Answer any one question from Q3 and Q4
3 (a) Show the output of each pass using bubble sort to arrange the following numbers in ascending order.
90, 87, 76, 65, 43, 32, 19, 7, 0, ?17.
6 M
3 (b) Explain the following terms:
(i) Data Object
(ii) Data Type.
3 M
3 (c) What is space complexity of an algorithm? Explain its importance with example.
3 M

4 (a) Explain the following terms:
(i) Internal sorting
(ii) External sorting
(iii) Sort stability.
6 M
4 (b) Explain the different asymptotic notations.
3 M
4 (c) Explain with example the linear data structure.
3 M

Answer any one question from Q5 and Q6
5 (a) Represent the sparse matrix using suitable data structure and write a pseudo C code to find transpose of a spare matrix using slow transpose.
7 M
5 (b) Explain the concept of column major address calculation for multidimensional array with suitable example.
4 M
5 (c) Represent the following polynomials using arrays:
i) x3+2xy+y3-y+x
ii) 5x2+10xy+y2-20.
2 M

6 (a) Write a pseudo C algorithm for addition of two sparse matrices. Analyze its time complexity.
7 M
6 (b) Explain sequential memory organization with example.
4 M
6 (c) What is sparse matrix ? Explain how it is represented.
2 M

Answer any one question from Q7 and Q8
7 (a) Suppose a Linked List consists of numerical values. Write a function for finding the maximum element of the List and the product of all the numbers in the List.
7 M
7 (b) Write a C code for reversing the Singly Linked List without using additional data structure.
6 M

8 (a) Write a pseudo code to merge two Sorted Linked Lists into the third.
7 M
8 (b) Explain GLL. Represent following polynomial using GLL
(L, (M, (N, (O, P)), Q), R, (S, T), (A, (B, C))).
6 M



More question papers from Fundamentals of Data Structures
SPONSORED ADVERTISEMENTS