0% found this document useful (0 votes)
18 views

CSE, CST, CSIT, CSAI, CSDS - DSC

Uploaded by

surajothers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

CSE, CST, CSIT, CSAI, CSDS - DSC

Uploaded by

surajothers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

`

DEPARTMRNT OF COMPUTER SCIENCE


RD
3 SEM CSE,CST,CSIT,CSAI,CSDS
SUB: DATA STRUCTURE QUESTION BANK
SHORT ANSWER TYPE
MODDULE-1

1. What do you mean by the efficiency of an algorithm? Discuss time and space complexity?
2. Which asymptotic notion is used to represent for lower bound of a function? Discuss it.
3. Express the following function Big Oh notation
F(n)=2n3+3n+5
4. What is data structure? Differentiate between linear and non linear data structure.
5. What do you understand by stack and queue? Give real life example from each.
6. Suggest a data structure that can be used to reverse the content of an array? Briefly explain
how your suggestion will help in solving the problem.
7. Differentiate between Binary Search and Sequential (linear) Search
8. Write the formulas to calculate the address of an element of a 2D array in row major order. If
the address of A[0][0] and A[0][1] are 1000 and 1010 respectively and each element occupies
2bytes then in which order do you think the array elements are stored and why you think so?
9. What is sparse matrix. Give an example. What are the disadvantages of representing it in
normal 2D array.
10. Discuss some areas of application of data structure?
MODULE-2
1. Define queue.
2. Define stack
3. Explain overflow and underflow condition in circular queue ( using array).
4. Discuss the advantages of circular queue over linear queue.
5. Write some areas of application of stack
6. Suggest a data structure that can be used to check whether an arithmetic expression has balanced
parenthesis or not? Explain how your suggested data structure can help to solve the problem.
7. Write some areas of application of queues
8. Write the equivalent postfix expression for the following infix expression:
(A + B) * (C - D)
9. If the elements "A", "B", "C" and "D" inserted into queue and are deleted one at a time, in what order
will they be removed?
10. Translate the following postfix to infix: A B * C +

MODULE 3
1. What is linked list? Name different types of linked list.
2. What is Self-referential structure? Explain with an example.
3. Differentiate between array and linked list.
4. Write two disadvantages of linked list over array?
5. Explain Doubly Linked list with a suitable example.
6. Explain Circular Linked List with a suitable example.
7. Represent the following polynomial using single linked list
`
5x3+4x2+5. Explain the node structure of such linked list.
8. What the following C code will do? Assuming that curr holds address of first node of a singly
linked list , n is an integer “next” is the link part of the node and “data” is the integer info part
of the node.
n=0;
while(curr!=NULL)
{
n=n+curr->data;
curr=curr->next;
}
printf(“%d”,n);
9. What the following c code will do? Assuming that curr holds address of first node of a singly
linked list ,n is an integer and next is the link part of the node
n=0;
while(curr != NULL)
{ n++;
curr=curr->next;
}
printf(“%d”,n);

10. A circular linked list contains four nodes {A, B, C, D}. Which node pointers should be updated
if a new node E is to be inserted at end of the list? Write the correct option from the following
(a) NEXT pointer of D and NEXT pointer of E
(b) NEXT pointer of E
(c) NEXT pointer of E and NEXT pointer of A
(d) NEXT pointer of E and START POINTER

MODULE 4
1. Define a tree recursively. Give an example of a binary tree.
2. How many structurally different binary trees are possible with 5 nodes.
3. What is graph? Give an example.
4. What is AVL tree? Give an example.
5. Represent the following general tree as a binary tree:

6. Construct an expression tree for the expression : A * B - (C + D) * (P /Q)


7. What is Max-heap? Give an example.
8. What is path matrix of a graph?
`
9. Define indegree and outdegree of a node in directed graph with an example.
10. What are the three traversal strategies used in binary tree? Find the inorder traversal of the
following binary tree

MODULE-5
1. What do you mean by Internal and External Sorting?
2. Compare the worst case time complexity of bubble sort, insertion sort, and quick sort
3. What is the output of selection sort after the 1st and 2nd iteration given the following sequence?
15 3 41 10 21 11
4. What is the disadvantage of selection sort?
5. What do you understand by divide-and-conquer strategy?
6. For a list L = {8, 99, 3, 4, 6, 10}, find the output list at the end of pass 1 using bubble sorting
method.
7. What is the need for hashing?
8. Define Collision in hashing.
9. Differentiate between Linear and Quadratic Probe?
10. What are the collision resolution methods?
`
FOCUSSED – SHORT ANSWER TYPE
MODDULE-1

1. What is algorithm? Discuss its properties


2. Discuss the various methods of representation of 2D array in memory with suitable examples.
3. In a two-dimensional array A[5][10] Deduce the address of the A[3][5] in row major order
and column major order. The base address of the array is 3000 and the size of element is
2bytes. Assume the lower bound of row and column indices to be 0.
4. Write an algorithm to find the largest and smallest element of an array
5. Write an algorithm to transpose a matrix
6. Write an algorithm for binary search.
7. Discuss the triplet representation of sparse matrix.
MODULE-2
1. Convert the following Infix expression to Postfix form using a stack.
A + B – (C*D – E + F/G) + (H + I*J), Follow usual precedence rule and assume that the
expression is legal..
2. Write an algorithm for deletion operation on linear queue using array. Five items A, B, C, D
and E are pushed to a stack, one after another starting from A. The stack is popped four times,
and each popped element is inserted in a queue. The two elements are deleted from the queue
and pushed back to the stack. Now one item is popped from the stack. Find the popped item
3. Write an algorithm to insert an element into a circular queue implemented using array.
4. Write algorithms for Push and Pop operation of stack implemented using array
5. Discuss postfix evaluation process using stack and evaluate the following postfix expression by
using a stack.
12 5 2 * 4 − 2 ^ 6 / + Where ^ is exponent operator
6. Briefly discuss about priority queue and double ended queue
7. Can we implement queue using stack(s)?If yes how many minimum no of stack we need.
Explain your answer.

MODULE-3
1. Write a code snippet for declaring the node of a doubly linked list. and create a node dynamically.
2. Difference between calloc() and malloc() in C.
3. Write an algorithm to reverse a single linked list?
4. Write an algorithm to find largest data value present in a singly linked list.
5. Write the algorithm for searching an element in a singly linked list.
6. Write the steps of the algorithm to insert a new node after the node pointed by P in the following
Linked List.
P
5 6 7

7. Explain header linked list with a suitable example.


`
MODULE-4
1. What are the different types of rotations in AVL trees? Explain with example for each.
2. Find topological ordering for the following graph:

3. Construct the binary tree whose preorder and inorder traversal are given
Preorder : a b d e g h c f n
Inorder : d b g e h a c n f
4. What is adjacency matrix? Find the adjacency matrix for the following graph:

5. Write DFS algorithm for graph traversal.


6. Define the following terms with respect to tree: height of a node, depth of a node, path, leaf
node with example from each.
7. Represent the following binary tree in an array

.
`
MODULE-5

1. Write a C function for selection sort.?


2. Explain how insertion sort works taking an example and showing the result of each pass.
3. Briefly describe radix sort and Sort the following data using radix/bucket sort:
42, 74, 11, 65, 94, 36, 87, 70, 81,1
4. Explain the merge sort process taking an example
5. Write any two techniques to overcome hash collision.
6. What are the application of hashing?
7. Explain Open addressing method.
`
LONG ANSWER TYPE QUESTIONS
MODULE-1
Q1. a) What is data structure? Briefly discuss the classification of data structure with examples.
b) What is pseudo code ? Write a pseudo code to delete an element from the array from a
given position.
Q2 a) Write a complete C program to implement binary search
b) Write an algorithm to insert an element into the array at a given position.
Q3 a) What is sparse matrix? Discuss various types of commonly used sparse matrices
a) Represent the following sparse matrix in triplet format

0 0 0 24 0 0
0
0 0 0 0 0 5
0
0 0 0 0 0 0
0
0 0 0 0 9 0
0
0 0 0 0 18
0 0
0 0 0 0 8 0
0

MODULE-2

Q1. Write a menu driven C program to implement the following operation on stack using array
i. PUSH ii. POP iii. DIPLAY to display content of Stack.
`
Q2. Write a menu driven C program to implement the following operations on linear queue
i. INSERT ii. DELETE iii. DISPLAY to display content of queue.
Q3.
a) Write an algorithm to delete an element from circular queue
b) Write algorithm to PUSH and POP elements from stack implemented using linked List

MODULE-3
Q1. a) Write a C program to create and display a singly linked list.
b) Write an algorithm to insert a node at the beginning of a doubly linked list.
Q2. a) Write an algorithm to insert a node in a singly linked list at the desired position.
b) Explain with a suitable diagram to implement queue using linked list. Further write the
pseudo code for ENQUEUE and DEQUEUE.
Q3. a) Write a C function to delete a node from a desired position of singly linked list
b) Write an algorithm / C function to traverse a circular linked list with at least one node.

MODULE-4
Q1. A) What is the difference between binary search tree (BST) and heap? For the given sequence
of numbers construct a BST : 34 , 23 , 67 , 45 , 12 , 54 , 87 , 43 , 98 , 75 , 84 , 93 , 31
B) For the same sequence of numbers construct a max heap

Q2. A) Write BFS algorithm for graph traversals. Perform BFS traversal for the following graph by
considering start node as 0.

.
B) What is single source shortest path problem. Find the length of shortest path from node “S” to
every other node for the below given graph using Dijstra’s algorithm
`

.
Q3. A) What is B-tree? State the properties of B-trees. Construct a B tree of order 3 by inserting data
as per following order: 78, 52, 81, 40, 33, 90, 85, 20 and 38.
B) Write C procedures/functions for the three different types of binary tree traversals

MODULE-5
Q1. (i) Discuss the Bubble sort technique taking the following array as example ? Explain each
pass. 12,34,5,78,4,56,10,23,1.
(ii) Write a C program to implement Bubble sort technique to sort the elements of an integer array
in descending order.
Q2. (i)Explain how quick sort works. Arrange the following elements in ascending order using quick
sort showing the result of every pass.
5, 14, 2, 9, 21, 34, 17, 19, 1, 44
(ii) Write the program to implement Insertion Sort.

Q3 . (i)What is hashing? Discuss any four hash function with example.


(ii) Discuss the Linear Probing Method. Discuss the disadvantages of Linear Probing Method
with an example..

You might also like