CSE, CST, CSIT, CSAI, CSDS - DSC
CSE, CST, CSIT, CSAI, CSDS - DSC
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:
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
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
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:
.
`
MODULE-5
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.