You are on page 1of 4

Data Structures and Applications

Questions from old VTU question papers


Module-1

1. What are pointer variable? How to declare a pointer variable. Write a function using pointers
to swap two numbers.
2. What are the various memory allocation techniques? Explain how memory can be
dynamically allocated using malloc
3. Define structure and union with suitable examples. Show how to declare and initialize them.
4. Develop a structure to represents the planets of a solar system. Each planet has fields for its
name, its distance from the sun and the number of moons it has. Write a program to read the
data of each planet and store it. Also print the name of the plane that has the highest number
of moons.
5. Give the triplet representation and the transpose for the sparse matrix given below

Col0 Col1 Col2 Col3 Col4 Col5


Row0 15 0 0 22 0 -15
Row1 0 11 3 0 0 0
Row2 0 0 0 -6 0 0
Row3 0 0 0 0 0 0
Row4 91 0 0 0 0 0
Row5 0 0 28 0 0 0

6. With a neat diagram show how the two polynomial A(x)= 3x300 +5 and B(X)= 5x3 + 2x2 +4x+7 can be
stored in an array. Give the corresponding structure definition.
7. Write a program to read a sparse matrix and search an element specified by the user.
8. What is a polynomial? What is the degree of the polynomial.? Write a function to find the
sum of two polynomials. Write the analysis of the function.
9. With suitable example. Explain the dynamic memory allocation of a 2D- array
10. Give nested structure definition to store the following data of the employee (emp-name,
emp_id, date of joining (dd,mm yy), salary(basic,DA, HRA).
11. Write a program for the following
a. Sort the elements of the array
b. Search a given element in a linear array using linear search
c. Search a given element in a linear array using binary search
12. Write function for the following
a. Inserting an element in to an array at a specified position
b. Deleting an element at a specified position from the array
c. To find the sum of two polynomials
d. Find the transpose of a sparse matrix
e. find a pattern in a string using KMP algorithms
f. Pattern matching by first comparing the last character.(nfind)

Module-2

1. What is recursion? What are the various types of recursion? When is a recursive function called well
defined.
2. Define stack. Give the C implementation for the push and pop (Also called Primitive
functions) function. Include conditions for full and empty conditions.
3. Explain how stack can be implemented using dynamic arrays.
4. Write the addq and deleteq functions of a circular queue. What is the advantage of circular
queue over linear queueFor the given circular queue write the values of front and rear after
each specified operation is performed .Queue full and empty condition should be considered0-
7 indicates the array indices.

5. Write a function to evaluate a postfix expression.


6. Obtain the postfix and prefix of (any given expression ).
7. Write an algorithm to convert and infix expression to postfix and convert the expression(any
expression can be given) to postfix.
8. Write the ADT of stack.
9. Write functions to insert into and delete from a circular queue.
10. Explain how circular queue can be implemented using dynamic arrays.
11. Write the push and pop functions to implement multiple stacks.
12. Write recursive function for
a. tower of Hanoi
b. Ackermann function.
c. Gcd of two numbers
d. Fibonicci series.

Module-3

1. What is a linked list. Explain the different types of linked list with diagram.
2. Write functions to insert in the front and rear of a singly linked list
3. Write functions to delete from the front and rear of a linked list.
4. Write a function to concatenate two linked list
5. Write a function to reverse a linked list
6. Write a function to insert a node at the front and the rear end in a circular list.
7. Write a C program to implement the insert and delete operation on a queue using linked list.
8. Describe the doubly linked with its advantages and disadvantages
9. Write a function to delete a node and insert a node into a doubly linked list.
10. Write a C function to find the sum of two polynomials
11. For the given(any matrix can be given) sparse matrix give the diagrammatic linked
representation.
12. Write a function to search for an item in a given linked list.

Module-4
1. With reference to the below figure answer the questions

a. Is it a binary tree
b. Is it a complete binary tree
c. Is it a full tree
d. Redraw the tree as extended binary tree
e. Write the inorder, preorder and postorder traversal.
f. Convert it to a threaded binary tree.
2. Write functions for the following
a. Finding the inorder successor of a node in threaded binary tree
b. Iterative function to search for a key value in a binary search tree
c. Recursive function to search for a key value in a binary search tree
d. To make a copy of a binary tree
e. To check if two tree is equal or not
f. Function to delete and element from a binary search tree
3. Show that for a non empty binary tree T. If n0 is the number of leaf nodes and of n2 is the number of
nodes with degree 2 then n0=n2+1.
4. What is a binary tree ? state its properties? How is it represented
5. Construct the binary tree from the following traversal
a. Preorder: ABDCEF
Inorder: BDAEFC
Postorder: DBFECA
b. Preorder: ABCDEFGHI
Inorder: BCAEDGHFI
6. What is a binary search tree? Write the binary search tree for the given input.14,5,6,2,18,20,16,18,-
1,21
7. Define the following root, sibling, degree, depth of a tree, ancestor
8. What is a threaded binary tree? What are its advantages ? Explain the right and left inthreaded binary
tree
9. Construct the binary tree for the expression A/B*C*D+E. Traverse the tree inorder, preorder and
10. Define ADT of binary search tree.
11. With an example explain the problem of satisfaibility. Also write the function to check the
satisfaibility of a prepositional formula and evaluate in postorder

Module-5

Module-5
1. Define Graph. Explain the different ways in which the graph can be represented
2. Explain the Depth first search traversal technique with an example. Write a function for the same
3. Explain the Breadth first search traversal technique with an example. Write a function for the same.
4. Explain the algorithm for insertion sort with an example.
5. Illustrate the working of radix sort with an example.
6. What is hashing? What are the two types of hashing? With example explain the various hashing
functions
7. What is overflow? Explain linear probing with an example. Give the drawbacks of lineat probing
8. What is dynamic hashing what are the two types of dynamic hasing.Explain any one with example.
9. What is a file? What are the various attributes of a file. What are the various operations that can be
performed on a file.
10. What are the different ways in which the files can be organized. Explain.
11. What are the different file indexing techniques. Briefly explain
12. Explain the data hierarchy? Explain the two types of file.

You might also like