Вы находитесь на странице: 1из 8

DATASTRUCTURES WITH C

10CS35
QUESTION BANK
PART A
UNIT 1
BASIC CONCEPTS

1) What is an algorithm? Briefly explain the criteria that an algorithm must satisfy.(08 Marks)
(JAN 2012)
2) Write a recursive function to implement binary search. (08 Marks)( JAN 2012)
3) Define big oh notation. Show that 3n+2= O(n) is correct. (04 Marks)( JAN 2012)
4) Define a pointer. Write a function to swap two numbers using pointers. (05 Marks)( JUN
2012)
5) Explain the function supported by C to carry out dynamic memory allocation. (05
Marks)(JUN 12)
6) Explain perform analysis and performance measurement. (10 Marks)(JUN 12)
7) What are pointer variables? How to declare a pointer variable? (05 Marks)( JAN 13)
8) What are the various memory allocation techniques? Explain how memory can be
dynamically allocated using malloc(). (10 Marks)( JAN 13)
9) What is recursion? What are the various types of recursion? (05 Marks)(JAN 13)
10) Explain pointer. With example explain pointer declaration, initialization and use of pointer in
allocating a block of memory dynamically. (06 Marks)( JUN 13)
11) Define recursion. Give two conditions to be followed for successive working of recursive
program. Give recursive implementation of binary search with propoer comments. (06 Marks)(
JUN 13)
12) Define three asymptotic notations and give the asymptotic notation of 3n+2 in all notations
and prove the same from first principle method. (08 Marks)(JUN 13)
Dept. of CSE, SJBIT

Page 1

DATASTRUCTURES WITH C

10CS35

13) Write the syntax and usage of the following: (06 Marks)( JAN 2014)
14) What is meant by rvalue and lvalue expression? Give example. (04 Marks)( JAN 2014)
15) Distinguish between static and dynamic memory allocation. With syntax explain four
dynamic memory allocation functions. Static Allocation of Variables. (10 Marks)( (JAN 2014)
UNIT 2
ARRAYS and STRUCTURES
1) Develop a structure to represent a solar system. Each planet has five fields name, distance, no
of moons. Write a program to read the data for each planet and store. Also print the name of the
planets that has the highest number of moons. (08 Marks)( JAN 2012)
2) For the given sparse matrix and its transpose, give the triplet representation using one
dimensional array. (08 Marks)( JAN 2012)
3) Consider two polynomials A(x)= 2x1000 + 1 and B(x)= x4 + 10x3 + 3x2 +1, Show
diagrammatically how they can be stored in a single 1 D array. Also give C representation. (04
Marks)( JAN 2012)
4) Define structures and unions with suitable example. (08 Marks)( JUN 2012)
5) WAP with an approporaite structure to store employee information like name, eid, DOJ(Date,
Mon, Year), and salary( basic, DA, HRA). (12 Marks)( JUN 2012)
6) What is the difference between int *a and int a[5] and int *[5]? (06 Marks)( JAN 13)
7) What is a structure? How to declare and initialize a structure? (06 Marks)(JAN 13)
8) WAP to read a sparse matrix of integer values and search for an element specified by the user.
(08 Marks)(JAN 13)
9) What is a structure? Give 3 different ways to define structure and declaring variables and
methods of accessing members of structures using a structure with rollno, name and marks of
three subjects as members of the structures as example. (06 Marks)( JUN 13)

Dept. of CSE, SJBIT

Page 2

DATASTRUCTURES WITH C

10CS35

10) Give the ADT of sparse matrix and show with suitable example sparse matrix representation
storing as triple. Give the function to transpose matrix and its complexity. (08 Marks)( JUN 13)
11) How would you represent two sparse polynomial using arrays of structures and also write a
function to add the polynomial and store the result in the same array. (06 Marks)( JUN 13)
12) Write a user defined function to in C to find if two fractions are equal. Use structure to store
the information. (06 Marks)( JAN 2014)
13) WAP to merge two integer files to produce a third file. (06 Marks)( JAN 2014)
14) WAP to concatenate first name and last name of a person without using any library function.
(08 Marks)( JAN 2014)

UNIT 3
STACKS AND QUEUES
1) Define stack. Give the C implementation of push and pop function. Include check for empty
and full conditions of stack. (08 Marks)(JAN 12)(JAN 13)
2) WAP to evaluate postfix expression. (08 Marks)( JAN 2012)
3) For the circular queue shown fill the values in the table. (04 Marks)( JAN 2012)
4) WAP to implement two primate functions on stack using dynamic memory allocation. (08
Marks)( JUN 2012)
5) Write an algorithm to convert infix to postfix expression and apply the same to the following:
(12 Marks)( JUN 2012)
6) Define stack. List the operation on stack. (08 Marks)( JAN 13)
7) Obtain postfix and prefix expression for ((( A+(B-C)*D)^E)+F). (06 Marks)( JAN 13)
9)Give the ADT of stack. Explain stack implementation. (06 Marks)( JUN 13)

Dept. of CSE, SJBIT

Page 3

DATASTRUCTURES WITH C

10CS35

10)Give the disadvantage of ordinary queue how is it solve din circular queue. (08 Marks)( JUN
13)
11) Convert a/b-c+d*e-a*c into postfix expression. Write a function to evaluate it for the given
data a=6, b=3, c=1, d=2, e=4. (06 Marks)( JUN 13)
12) Define stack. List atleast four application of stack. (05 Marks)( JAN 2014)
13) Write the algorithm to evaluate a postfix expression and trace 123 + * 321 - + *. (08
Marks)( JAN 2014)
14)WAP to implement primitive stack operation. (07 Marks)( JAN 2014)
UNIT 4
LINKED LISTS
1) Explain how a chain can be used to implement a queue. Write the function to insert and delete
elements from the queue. (08 Marks)( JAN 2012))(JAN 13)
2 ) Describe DLL with advantages and disadvantages. (08 Marks)( JAN 2012)
3) For the given sparse matrix give the diagrammatic linked representation. (04 Marks)( JAN
2012)
4) Define linked list. WAP to implement insert and delete operation on queue using linked list.
(10 Marks)( JUN 2012)
5) WAP to add two polynomials using linked list. Explain with a suitable example. (10 Marks)(
JUN 2012)
(10 6) What is linked list? Explain the types of linked list with diagram. Marks)( JAN 13)
7) Write a function to insert a node at front and rear end in a circular linked list. Write down the
steps to be followed. (10 Marks)( JAN 13)
8) Give the node structure to create a linked list of integers and write C functions to the
following: (08 Marks)( JUN 13)

Dept. of CSE, SJBIT

Page 4

DATASTRUCTURES WITH C

10CS35

9) With a node structure show how would you store the polynomials in linked list? Write a C
function for adding two polynomials represented as circular list. (06 Marks)( JUN 13)
10) Write a note on: (06 Marks)( JUN 13)
i. Linked list representation of sparse matrix
ii. Doubly linked list
11) What is recursion? Evaluate fib(4) using recursion. (08 Marks)( JAN 2014)
12) Write the static implementation of priority queue in C language. With illustration explain the
limitations. (12 Marks)( JAN 2014)
PART B
UNIT 5
TREES 1
1) With reference to the fig, answer the following: (08 Marks)(JAN 12)
i) Is it a binary tree?
ii) Is it a complete binary tree?
iii) Give the preorder traversal
iv) Give the inorder traversal
v) Give the list notataion
vi) Where will be the left child of node 4 pointing to, if it is converted to a threaded binary tree?
vii) Is it a max heap?
2) Write the function for: (08 Marks)(JAN 12)
i) Counting the number of leaf nodes in a tree.
ii) Finding the inorder successor of a node in a threaded b-tree.
Dept. of CSE, SJBIT

Page 5

DATASTRUCTURES WITH C

10CS35

3) S.T for non-empty b-tree T, if n0 is the number of leaf node and n2 is the number of degree 2,
then n0 = n2+1. (04 Marks)(Jan 2012)
4) Define binary trees. For the given tree find the following: (08
Marks)( JUN 2012)
i) siblings
ii) Leaf nodes
iii) Non-leaf nodes
iv)Ancestor
v) Level of trees
5) WAP to traverse a given tree.(12 Marks)
6) What is a tree? Explain : i)root node ii) siblings iii) ancestors. (06 Marks)( JAN 13)
7) What is a binary tree? How is it represented using linked list and arrays? (10 Marks)(JAN
13)(JUN 13)
8) What is a heap? Explain the different types of heap. (04 Marks)(Jan 13)
9) Write an expression tree for A/B+C*D+E. Give the algorithm for inorder, preorder and post
order. (08 Marks) (JUN 13)
10) Define max heap. Explain clearly inserting value 21 in heap. (06 Marks)(Jun 13)
11) Give the structural features of linked list. Discuss how an array can be used to store a linked
list. (05 Marks) JAN 2014
12) Give SLL with plist as external pointer. Write an algorithm to write a new value at the end of
the list. (05 Marks)
13) How is stack implemented using SLL. (10 Marks)

Dept. of CSE, SJBIT

Page 6

DATASTRUCTURES WITH C

10CS35
UNIT 6
TREES 2, GRAPHS

1) Write c function for the following tree traversals: i) inorder ii)preorder iii)postorder (10
Marks) (JAN 12)
2 Explain the following with an example: i) forest ii) graph iii) winner tree. (10 Marks) (JAN
12)
3) Describe the binary search tree with an example. Write a iterative function to search for a key
value in a binary search tree . (08 Marks) (JUN 2012)
4) Explain representation of disjoint sets. (04 Marks) (JUN 2012)
5) Explain heap and heap sort. (08 Marks) (JUN 2012)
6) WAP to implement min heap. (10 Marks) (JAN 13)
7) Explain min and max heap with example. (10 Marks)( JAN 13)
8) Define a BST and construct a BST with { 22, 28, 20, 25,22, 15, 18,10, 14}. Give the recursive
search algorithm to search for an element. (10 Marks) (JUN 13)
9)What is a winner tree? Explain winner tree for k=8. ( 10 Marks) (JUN 13)
10) What is a CLL. Write the algorithm to merge two CLL. (10 Marks) ( JAN 2014)
11) How to implement a queue using CLL. (10 Marks) ( JAN 2014)
UNIT 7
PRIORITY QUEUES
1) What is binomial heap? Explain the steps involved in the deletion of min element from a
binomial heap. (10 Marks)( JAN 2012)
2) Define Fibonacci heap. Briefly explain the different types.(10 Marks)(JAN 2012)(JAN
13)(JAN 14)
3) Explain priority queue? (10 Marks)( JUN 2012)(JAN 14)
Dept. of CSE, SJBIT

Page 7

DATASTRUCTURES WITH C

10CS35

4) Explain pairing heaps. (10 Marks)( JUN 2012)(JAN 13)


5) Define leftlist trees. Explain varities of leftlist tree. (08 Marks)( JUN 13)
6) Write short notes on: (12 Marks)
i) Priority queue.
ii) Binomial heap.
iv) Fibonacci heap.
UNIT 8
EFFICIENT BINARY SEARCH TREES
1) Describe the following with an eg: i) height balanced trees ii) optimal bst. (10 Marks)( JAN
2012)(JUN 13)(Jan 14)
2) Explain the Red-black tree. State its properties. ? (10 Marks)( JAN 2012)(JAN 14)
3) Write a note on: pointers, heap, and algorithm to evaluate postfix expression. (20
Marks)(JUN 12)
4) Write a note on binomial heap. (6 Marks)( JAN 13)
5) Write a note on circular queues.(10 Marks)( JUN 13)(JAN 14)
6) Write a note on : (5 Marks)( JAN 2014)
(i)Splay tree

Dept. of CSE, SJBIT

Page 8

Вам также может понравиться