Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

MODULE 1: INTRODUCTION

1. Define data structures? How they are classified? Explain its various operations?
2. What is a structure in C? How is it different from an array? Explain with example
how a structure is declared and initialized? (06 M, June 2009, Jan 2012)
3.Write a C program with an appropriate structure definition and variable declaration
To read an display information about 5 employees using nested structures.
Consider the following fields like Ename, Empid, DOJ (Date, Month, Year) and
Salary (basic, DA, HRA). (12 M, June 2012,Jan 2015,July 17)
4.How does a structure differ from a union? Mention any 2 uses of structure. What
is a bit field? Why are bit fields used with structures?
( 0 6 M,Dec 2010, June 2012)
5.Write a C program to read ten integers and store them in an array using pointers.

Print their sum and average. (10 M, June 2010)

6. Write a note on static and dynamic memory allocation and explain with examples.

(10M, June 2009 Dec 2010)

7..With a suitable example, explain dynamic memory allocation for 2-d arrays.
(04 M,June 2014)
8.What is the difference between int*a and int a[5] and int*[5]?
(06M, Jan 2013)
9.Write a C program using pointers to swap two (numbers) characters.

(06M,June2008, 2012)

10. What is a pointer variable? How do you declare and initialize the pointers? How

do you access the value pointed by a pointer? (05 M, Dec 2010)

11.Write a C program to find the smallest element in the array (using pointer and

function? (07M, Dec 09)

12.What do you mean by casting pointers? Give example. (04 M, June 2012)

13.What is pointer to an array and array of pointers? Explain with example.

(08 M, July 2011)


14.What are the various memory allocation techniques? Explain how memory can be

dynamically allocated using malloc()? (10M, Jan 2013, 2015)

or

15. list an explain the functions supported by C for dynamic allocation.


(04 M,july 2017)
16.Consider two polynomials A(x)=2x1000 + 1 and B(x)= x4+10x3+3x2+1, show
diagrammatically how these two polynomials can be stored in a single 1-D array.
Also give its C representation. (05 M, Dec 2011, June 2015)
17. For the given sparse matrix and its transpose, give the triplet representation using
one dimensional array. A is the given sparse matrix, b will be its transpose
(08 M, Dec 2011)
18. What is a polynomial? What is the degree of the polynomial? Write a function to
add two polynomials? (08 M, Jan 2014,july 2017)
19. For a the given sparse matrix A and its transpose, give the triplet representation.
A is the given sparse matrix, and B will be its transpose.
(08 M, Jan 2014,June 2015)

20. write a fast transpose algorithm to transpose the given sparse marix. Express the
above given (Fig Q2(c)) sparse matrix as triplets and find its transpose.
(08 M,Jan 2017)
21.Describe briefly the various types of structures used for storing strings?
(model questions)
22.Write a program that reads a character string and finds the number of vowels and
consonents in it?
23.Write a program to determine whether the given string STR is palindrome or not?
24. write a function to sort integers using selection sort algorithm.
(04 M, Jan 2017)
25.Consider the two polynomials,A(x)=4x15+3x4+5 and B(x)=x4+10x2+1.show
diagrammatically how these two polynomials can be stored in an 1D array.Also
give its C representation (04 M,Jan 2017)
26. Give ADT of sparse matrix and show with suitable example sparse matrix
representation storing triples.Give sample transpose function to transpose function
to transpose sparse matrix. (08M,july 2017)
27. write the Knuth morris pratt pattern matching algorithm and apply the same to

search the pattern ‘abcdabcy’ in the text ‘abcxabcdabxabcdabcabcy’.

(08 Marks Jan 2017)

MODULE 2:STACKS AND QUEUES


1.Define stack. Write the ADT of stack. Give the C implementation of push and pop

functions. Include check for empty and full conditions of stack.

(08 M, Dec 2011, Jan 2014, Jan 2015)

2. Write a C program to implement the two primitive operations on stack using dynamic

memory allocation. (08 M, June 2012)

3.Write a C program to convert a valid infix expression to prefix expression and infix

to postfix expression. Demonstrate the same function with example.

(12 M, June 2012, July 2011)

4. Write a C function to evaluate and trace a postfix expression.

(08 M, Dec 2011, June 2012, June 2010)

5. Transform each of the following expressions to prefix and postfix;

i. A$B*C-D+E/F/(G+H)
ii. A-B/(C*D$E) (04 M, June 2012)

6. Write the postfix form of the following expressions

i) (a+b)*d+e/(f+a*d)+c
ii) ((a/(b-c+d))*(e-a)*c)
iii) a/b-c+d*e-a*c. (06 Marks, Jan 2014,Jan 2017)

7.Explain infix to postfix expression algorithm and trace it for an expression

“a*(b+c)*d” (08 Marks, June 2014)

8.Write a C function to evaluate a postfix expression and apply the same to evaluate

AB+CDE-*/, A=5, B=6, C=4, D=3,E=7. (12 Marks, June 2015)

9.Write a recursive function to implement factorial? (07 Marks, Dec 2011)


10. Write a recursive function for Fibonacci series for the nth number.
(05 Marks, Dec06)
11.Write a C program to simulate the working of linear queue. Provide the following

operations. i)insert ii) delete iii) display (08 Marks, Jan 2010)

12. Implement addq and deletq functions for the circular queue using dynamically

allocated arrays. (06 Marks, Jan 2014,july 2017)

13. What is priority queue? Explain different types of priority queues.

(05 Marks, June 12)

14. Explain with an example advantages of circular queue over a linear queue.

(05 Marks, June 2012, Dec 2010, June 2014)

15. How multiple stacks implemented using one dimensional array? Explain with a

suitable example. (04 Marks, June 2014)

16. write the algorithm to implement a stack using dynamic array whose initial capacity

is 1 and array doubling is use to increase the stack’s capacity(that is allocated

dynamically twice the memory)whenever an element is added to a full.Implement

the operation -push,pop and display. (08M,Jan 2017)

17. list the disadvantages of linear queue and explain how it is solved in linear queue.

Give the algorithm to implement a circular queue with example.(08M,Jan 2017)


MODULE 3. LINKED LISTS

1. What is a linked list? Compare static and dynamic implementation of linked list ?
(10 Marks, June 2012)
2. Write routines in C to perform the following operations in dynamic single linked
list; i)To insert X into its proper position within the list; ii) To delete all nodes whose
into field contains the value of X. (10 Marks, June 2012)
3. What is a doubly linked list? What are advantages of doubly linked list over single
linked list? Illustrate with an example. Write C routines to perform the following
operations on doubly linked list; i)To delete node pointed to by P; ii)To insert node
to the right of P. (10 Marks, June 2012 July 2011,June 2015,jan17)
4. Write a C program to implement stack as a circular list. (10 Marks, June 2012)
5. Write a C program to implement the inset and delete operations on a queue using
linked list. (10 Marks, June 2012, Dec 2010)
6. Write a C function to add 2 polynomials using linked list representation. Explain
with suitable example. (10 Marks, June 2012)
7. Write a C program to implement the inset and delete a node in Doubly Linked List
with respect to given position. (10 Marks, July 2011)
8. What is dynamic memory allocation? Write a function to delete a node from a
circular linked list. Proper error message should be displayed.
(10 Marks, July 2011)
9. What are the advantages and disadvantages of representing a stack or queue by a
linked list? (04 Marks, Jan 2010)
10. Write a C program to implement stack operations using singly linked list.
(10 Marks, Jan 2010)
11. Write a C program to implement the inset a node to the list at the front and delete a
node from front end of doubly linked list. Assume that first and last are external
pointers to the first and last nodes of a doubly linked list
(10 Marks, Jan 2010, July 2009)
12. What is linked list? Explain the different types of linked list with diagrams?
(10 Marks, Jan 2013,Jan 2015)
13. Write a function to insert a node at front and rear end in a circular linked list. Write
down sequence of steps to be followed? (10 Marks, Jan 2013, June 2015)
14. For the given sparse matrix write the diagrammatic linked list representation?
(06 Marks, Jan 14,jan17)
15. Define equivalence class. Write the linked list representation for the twelve
polygons numbered 0 through 11 using the following pairs overlap?
0=4, 3=1, 6=10, 8=9, 7=4, 6=8, 3=5, 2=11, 11=0. . (08 Marks, Jan 2014)
16. Write the node structure for linked representation of polynomial. Explain the
algorithm to add two polynomials represented using linked lists.
(08 Marks, June 2014)
17. Write a C function to
i)reverse the given singly linked list
ii)concatenate two singly linked list. (10 Marks, June 2014, jan2015)
18. write the functions for singly linked list with integer data to search an element in the
list. (08M,Jan 17)

MODULE 4:TREES
1. Define binary trees? Mention the properties of binary tree? For the given tree find the
following: (08 Marks, June 2012)
i. Siblings
ii. Leaf nodes
iii. Non leaf nodes
iv. Ancestors
v. level of trees
A

B C

D E F

2. What is a binary tree? How it is represented using array and linked list? Give example?
(09 Marks, Jan 2013, Jan
2014)
What is a binary tree? Show the array representation and linked representation for the
following binary tree. (05 Marks, June 2015)
A

E F

3.Illustrate with a suitable example define :


i)Binary tree
ii)Degree of a binary tree
iii)Level of a binary tree
iv)Sibling (10 Marks, June 2014)
4.Define the following:
i)Binary tree
ii)Complete binary tree
iii)Almost complere binary tree
iv)Binary search tree
v)Depth of a tree (10 Marks, Jan 2015)
5. Explain the array representation of binary tree and write a function to search a given element
in binary search tree using array representation. (08 Marks, Jan 2009)
6. Write the C routine to traverse the given tree using
i. In Order
ii. Pre order
iii. Post order (12 Marks, June 2012,Jan 2015)
7. Define post order and preorder traversal of tree. Given the post order and pre order traversal,
construct a single binary tree.
POST ORDER: J H D E B I F G C A
INORDER: D J H B E A F I C G (10 Marks, June 2011)
8.Write an algorithm to construct binary tree for finding and eliminating duplicate numbers
from the list of numbers. Trace the algorithm for the input:
14,15,4,9,7,18,3,5,16,4,20,17,9,14,5. (10 Marks, June 2012)
9.Draw the binary tree for the following expression 3+4*(6-7)/5+3. Traverse above constructed
tree using preorder and post order. (06 Marks, July 2009)
10.What do you meant by threaded binary tree? Discuss the impact of such a representation on
tree traversal procedure. (08 Marks, July 2009)
11.Write a C function that searches for an arbitrary element in a max heap?
(05Marks, Dec 2011)
12.For any nonempty binary tree, T, if n0 is the number of leaf nodes and n2 the number of
nodes of degree 2, then prove the n0= n2+1. (04 Marks, June 2014)
13.What is the advantage of threaded binary tree over binary tree? Explain threaded binary tree
construction with a suitable example. (08 Marks, June 2014)
14.Write an expression tree for the expression A/B*C*D+E. Give the C function for
inorder,preorder,postorder traversals and apply the traversal methods to the expression tree
and give the result of traversals. (05 Marks, June 2015)
15.What is a max heap? Construct the max heap for 7,8,3,6,9,4,10,5
16.Construct the binary tree for the following expression:
i. Pre order: / + * 1 $ 2 3 4 5
ABDGCEHIF
ii. In Order: 1 + 2 * 3 $ 3 – 5
DGBAHEICF (08 Marks, June 2012)

17.Write an expression tree for the expression A/B*C*D+E. Give the C function for
inorder,preorder,postorder traversals and apply the traversal methods to the expression tree
and give the result of traversals. (05 Marks, June 2015)
18.What is binary search tree? Draw the binary search tree for the following inputs:
i)14, 5, 6, 2, 18, 20, 16, 18,-1, 21 (10 Marks, Jan 2013)
ii) 14,15,4,9,7,18,3,5,16,4,20,17,9
19.Write the following functions for binary search tree:
i. inserting a new node
ii. for display (10 Marks, June2012)
20.Describe the binary search tree, with an example. Write a recursive function to search for
a key value in a binary search tree. (08 Marks, Jan 2014)
21.Construct the binary tree from the given traversals:
Preorder:ABDGCEHIF
Inorder:DGBAHEICF (05 Marks, June 2015)
MODULE 5. GRAPHS,HASHING,FILES AND THEIR ORGANISATION
(New scheme-model questions)
1. Define graphs? Explain with example ,the various methods available for representing
a graph?
2. Explain with example various operations on graphs?
3. Explain with a c code how to traverse a graph?
4. What is hasing? How is it useful. Explain in detail.?

7. what is a graph? Give the matrix and adjacency list representation of graph?
(08 M,Jan17)
. ( 08M,Jan17)

9. what are the methods for traversing a graph? Explain in detail with an example?

( 08M,June17)

10 Write the difference between graphs and trees? For the given graph show the
adjacency matrix and adjacency list representation? ( 08M,June 17)

12 What is collision? What are the methods to resolve collision?explain linear probing

with an example. (08M,June 17)

14. Explain open addressing and chain used to handle overflows in hashing? (08M,Jan17)

15. Construct a leftist tree?

You might also like