Data Structure Question Bank
Data Structure Question Bank
PREPARED BY
K.ASHOK KUMAR
Associate Professor/CSE
UNIT I -LINEAR DATA STRUCTURES – LIST
Abstract Data Types (ADTs) – List ADT – array-based implementation – linked list
implementation –– singly linked lists- circularly linked lists- doubly-linked lists – applications of
lists –Polynomial Manipulation – All operations (Insertion, Deletion, Merge, Traversal).
Q. Questions
No
PART =A
1 Define ADT. Give any two examples.
2 Distinguish between linear and nonlinear data structures.
3 Compare calloc() and realloc() function and mention its application in linked list.
4 Describe the differences between singly and doubly linked lists.
5 List out the areas in which data structures are applied extensively.
19 Should arrays or linked lists be used for the following types of applications? Support
your justification.
1. Many search operations in sorted list.
2. Many search operations in Unsorted list.
20 Develop an algorithm for insertion operation in a singly linked list.
PART- B
1 Describe the following:
i. Applications of lists. (5)
ii. Polynomial manipulation. (8)
2 i. What is a linked list? (2)
ii. Describe the suitable routine segments for any four operations. (11)
3 List an algorithm to perform the following operations in a doubly linked list.
Q.
No Questions
PART - A
1 Point out the advantage of representing stack using a linked list than array.
2 Point out the rules followed during the infix to postfix conversions.
3 Compare the working of stack and queue data structure.
4 Develop an algorithm for inserting a new element into the stack.
5 What are priority queues? What are the ways to implement priority queue?
6 List any four applications of stack.
7 Given the prefix for an expression. Write its postfix:
-*-+abc/ef-g/hi
8 Describe how the following "infix" expression is evaluated with the help of the help of
Stack : 5 * ( 6 + 2 ) - 12 / 4
9 Give the postfix and prefix forms of the expression: A + B*
(C – D) / (P – R)
10 Define double ended queue.
11 List the applications of a queue.
12 What are the applications of priority queue?
13 What is circular queue?
14 Circular queue is better than standard linear queue, Why?
15 Classify the different types of queues.
16 Illustrate the difference between a queues and linked lists with an example.
17 Complete a routine to display the contents of queue.
18 Analyze and write a routine to check whether the queue is full or empty.
19 For railway reservation the queue data structure is preferred –Justify.
20 Develop an algorithm for deleting an element in a double ended queue.
PART - B
1 Describe with an example how to evaluate arithmetic expressions using stacks.
2 i. Explain array based implementation of stacks.
ii. Explain linked list implementation of stacks.
3 i. Describe about stack ADT in detail.
ii. Explain any one application of stack.
4 Explain the following expressions with an example.
i. Prefix and infix.
ii. Postfix.
5 i. Write an algorithm to convert an infix expression to a postfix
expression.Trace the algorithm to convert the infix expression (a+b)*c/d+e/f
to a postfix expression.
ii. Justify the need for Infix and Postfix expression.
6 i. Give an algorithm for push and pop operations on stack using a linked list.
ii. Discuss about addition and deletion operations performed on a circular
queue with necessary algorithms.
7 i. Describe the process of postfix expression evaluation with an example.
ii. Describe the process of conversion from infix expression to postfix
expression using stack.
8 i. Write an algorithm that checks if expression is correctly parenthesized using stack and
illustrate with an example.
ii. Write the function to examine whether the stack is full() or empty()
9 i. Describe about queue ADT in detail.
ii. Explain any one application of queue with suitable example.
10 Briefly describe the operations of queue with examples.
11 Analyze and write an algorithm to implement queue functions using arrays.
12 Develop an algorithm to perform the four operations in a double ended
queue that is implemented as an array.
13 Discuss circular queue and its implementation.
14 Illustrate the enqueue and dequeue operations on double ended queues.
PART - C
1 Develop and Show the simulation using stack for evaluation of the following
expression :
12 + 3 * 14 – (5 * 16) + 7
2 Explain an algorithm to implement the circular queue using arrays. List the
applications of Queues.
3 Assess the difference between double ended queue and circular queue. Show the
simulation using stack for the following expression to convert infix to postfix: p * q =
(r-s / t).
4 Develop an algorithm to explain Priority Queue, deQueue and the applications of queues.
UNIT III -NON LINEAR DATA STRUCTURES-TREES
Tree ADT – tree traversals - Binary Tree ADT – expression trees – applications of trees –
binarysearch tree ADT –Threaded Binary Trees- AVL Trees – B-Tree - B+ Tree - Heap –
Applications of heap.
Q. Questions
No
PART - A
1 If the depth of the binary tree is k, the maximum number of nodes in the
binary tree is 2k-1.Justify
2 For the given binary search tree, if we remove the root and replace it with something
from left sub tree. What will be the value of the new root? Justify your answer.
3 Find out the in-degree and out-degree of each node in the given graph
4 Create a complete undirected graph having five nodes
5 Given the following adjacency matrix, draw the weighted graph.
6 When do you say a graph is bi-connected?
7 Give the purpose of Dijikstra’s algorithm.
8 Differentiate cyclic and acyclic graph
9 Classify strongly connected and weakly connected graph.
10 How to find all articulation points in a given graph?
11 Define the length of the graph.
12 Define minimum spanning tree. Give an example
13 State the principle of Topological sorting.
14 Explain procedure for Depth first search algorithm.
15 Analyze Bi-connectivity.
16 Prove that the number of edges in a complete graph of n vertices inn(n-1)/2
In a complete graph with n vertices, show that the number of spanning trees is at
17 least 2 n-1-1
18 What are Euler circuits?
19 Give two applications of graphs.
20 What is residual graph?
PART - B
1 Describe in detail about the following representations of a graph.
i. Adjacency Matrix
ii. Adjacency List
2 i. Consider the given directed acyclic graph D. Sort the nodes D by applying
topological sort on ‘D
ii. Consider the graph given below and show its adjacency list in the memory
8 Compare any two applications of Graph and describe with your own example
9 Describe any one of the shortest path algorithms with suitable example
10 Discuss the prim’s algorithm for minimum spanning tree. Give an example.
11 i. Write a program to find an Euler circuit in a graph.
ii. Trace the algorithm for the given graph.
PART – A
Q.No Questions
1 What are the advantage and disadvantage of separate chaining and linear
probing?
2 Define extendible hashing.
3 Give the fastest searching algorithm.
4 What is meant by internal and external sorting? Give any two examples for
each type.
5 Describe the complexity of bubble sort.
6 Name the applications of linear and binary search techniques.
7 Give the time complexities of bubble sort and quick sort.
8 Predict the fastest sorting algorithm, justify.
9 Compare internal and external sorting.
10 Distinguish between linear and binary search technique.
11 Classify the different sorting methods.
12 Develop an algorithm for a quick sort.
13 Which hashing technique is best and illustrate with an example?
14 Summarize the open addressing hashing method with an example.
15 Point out the advantages of using quick sort.
16 Compare the working of linear and binary search techniques.
17 Select the best sorting method out of the following - insertion sort, quick sort
and merge sort and give justification.
18 Illustrate the time complexity of insertion sort with an example.
19 Identify the advantage of shell sort over insertion sort.
20 Develop a simple algorithm for a linear search.
PART -B
1 Describe how the divide and conquer technique is implemented in binary
search.
2 Describe the algorithm to sort the following array: 77, 33, 44, 11, 88, 22, 66,
55
i. Insertion sort
ii. Shell Sort
3 i. List the different types of hashing techniques?
ii. Explain them in detail with an Example.
4 i. Interpret the result of inserting the keys 2, 3, 5, 7, 11, 13, 15, 6, 4 into an initially
empty extendible hashing data structure with M = 3.
ii. Discuss the running time of Divide-and-Conquer Merge sort algorithm.
5 i. Sort the sequence 3, 1, 4, 1, 5, 9, 2, 6, 5 using Insertion sort.
ii. Describe the routine for insertion sort.
6 Write an algorithm to sort a set of ‘N’ numbers using quick sort.Demonstrate
the algorithm for the following set of numbers: 88,11,22,44,66,99,32,67,54,10.
7 Explain the various collision resolution techniques in detail with an example.
8 Compare the below different Sorting methods and discuss about each method in a very
detailed Manner.
i. Bucket Sort.
ii. Selection Sort .
9 i. Sort the given integers and Explain the intermediate results using shell sort:
35,12,14,9,15,45,32,95,40,5.
ii. Write and Explain a C code to sort an integer array.
10 i. Createa algorithm to perform a binary Search.
ii. Develop an algorithm for Merge sort with an example.
11 i. Write short notes on Bubble Sort.
ii. Illustrate an algorithm to sort the elements using bubble sort.
12 Describe the following collision resolution techniques in detail with an example.
i. Separate chaining.
ii. Rehashing.
13 i. Explain different hashing technique.
ii. Explain the rehashing technique with suitable example.
14 Describe the open addressing and chaining methods of collusion resolution techniques in
hashing.
PART C
1 Develop an algorithm to search a number in a given set of numbers using
binary search. Develop and algorithm to explain Extendible Hashing.
2 Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x)= x(mod
10), show the resulting
i) Open hash table
ii) Closed hash table using linear probing
iii) Closed hash table using quadratic probing
3 Explain an algorithm for Shell Sort and Merge Sort and explain with example.
4 Prepare a quick sort algorithm and explain with suitable example Give its worst case,
average case and best case time complexities.