0% found this document useful (0 votes)
53 views14 pages

Data Structures

This document contains a question bank for the subject 1904007 - Data Structures for the 5th semester. It is prepared by Mr. N. Leo Bright Tennison and contains questions divided into multiple parts (A, B and C) covering two units - Linear Data Structures (Lists, Stacks and Queues) and Non-Linear Data Structures (Trees and Graphs). The questions range from basic recall to higher order thinking and application-based questions to assess different cognitive levels. An introduction is provided describing the structure of the document.

Uploaded by

Abhinay Anurag
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)
53 views14 pages

Data Structures

This document contains a question bank for the subject 1904007 - Data Structures for the 5th semester. It is prepared by Mr. N. Leo Bright Tennison and contains questions divided into multiple parts (A, B and C) covering two units - Linear Data Structures (Lists, Stacks and Queues) and Non-Linear Data Structures (Trees and Graphs). The questions range from basic recall to higher order thinking and application-based questions to assess different cognitive levels. An introduction is provided describing the structure of the document.

Uploaded by

Abhinay Anurag
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/ 14

SRM VALLIAMMAI ENGINEERING COLLEGE

(An Autonomous Institution)


SRM Nagar, Kattankulathur – 603 203

DEPARTMENT OF
COMPUTER SCIENCE ANDENGINEERING

QUESTION BANK

V SEMESTER

1904007- DATA STRUCTURES

Regulation – 2019

Academic Year 2021 – 2022

Prepared by

Mr. N. LEO BRIGHT TENNISSON (Sr. G. / CSE)

1
SRM VALLIAMMAI ENGINEERING COLLEGE
(An Autonomous Institution)
SRM Nagar, Kattankulathur-603203
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK

SUBJECT :1904007- DATA STRUCTURES


SEM/YEAR: V/III
UNIT I - LINEAR DATA STRUCTURES - LIST
Introduction to structure-Abstract Data Types (ADTs) - List ADT - array-based implementation - linked
list implementation - singly linked lists- circularly linked lists - applications of lists –Polynomial
Manipulation.

PART – A
BT Competence
Q.No Questions Level
1 What is Circular list? Give an example with diagram. BTL-1 Remember

2 Differentiate linear and nonlinear data structures. BTL-2 Understand


Compare calloc () and realloc () function and mention its
3 BTL-4 Analyze
application in linked list.
4 Define ADT. Give any two examples. BTL-1 Remember
5 List out the areas in which data structures are applied extensively. BTL-1 Remember
6 Define iterators. Give example. BTL-1 Remember
7 Compare singly linked list with circular linked list. BTL-5 Evaluate
8 State the advantage of ADT. BTL-1 Remember
9 List out the advantage of circular linked list. BTL-1 Remember
10 Binary search cannot be performed on a linked list. Examine. BTL-3 Apply
11 Discuss the advantages and disadvantages of linked lists and arrays. BTL-2 Understand
12 Give an example for linked list application. BTL-2 Understand
13 Specify the use of Header node in a linked list. BTL-6 Create
14 Illustrate the use of linked list with an example. BTL-3 Apply
15 Show the ways in which list ADT can be implemented. BTL-3 Apply

16 Differentiate arrays and linked lists. BTL-2 Understand

17 Analyze and write a find routine in array implementation. BTL-4 Analyze


Analyze and write the array representation of a
18 BTL-4 Analyze
polynomial: p(x) = 4x3+6x2+7x+9

2
Should arrays or linked lists be used for the following types of applications?
Support your justification.
19 BTL-5 Evaluate
1. Many search operations in sortedlist.
2. Many search operations in Unsortedlist.
20 Develop an algorithm for insertion operation in a singly linked list. BTL-6 Create

PART – B
Describe the following:
1 i. Polynomial manipulation(7) BTL-1 Remember
ii. Applications of lists.(6)
What is a linked list? Describe the suitable routine segments for any four
2 BTL-1 Remember
operations in a linked list. (13)
List an algorithm to perform the following operations in a doubly linked list.
3 i. Insert a node at the end of thelist.(7) BTL-1 Remember
ii. Delete the last node in the list.(6)
i. Discusstheinsertionanddeletionproceduresforcursorbasedlinkedlists.(7)
4 ii. Give an algorithm for the deletion and reverse operations on doubly linked BTL-2 Understand
list. (6)
i. Give the algorithm to perform insertion on a doubly linkedlist.(7)
5 BTL-2 Understand
ii. Give the algorithm to perform deletion on a doubly linkedlist.(6)
Write an algorithm to demonstrate a polynomial using a linked list for
6 i.Addition and Subtraction. (7) BTL-3 Analyze
iii. Multiplication operations. (6)
Analyze and write algorithm for Circular Linked list for the following
operations using structure pointer.
7 BTL-4 Analyze
i. Create & Insert.(6)
ii. Delete &Display.(7)
Explain the application of linked list in detail.
8 i. Radix sort. (7) BTL-4 Apply
ii. Multi list.(6)
Consider an array A[1: n] Given a position, write an algorithm to insert an
element in the Array. If the position is empty, the element is inserted easily. If
9 the position is already occupied the element should be inserted with the BTL-5 Evaluate
minimum number of shifts. (Note: The elements can shift to the left or to the
right to make the minimum number of moves). (13)
Develop a program to add the values of the nodes of a linked list and then
10 BTL-6 Create
calculate the mean. (13)
11 Describe the various operations of the list ADT with examples. (13) BTL-1 Remember

3
i. Illustratethepolynomialrepresentationfor6x3+9x2+7x+1usinglinkedlist.
Writeproceduretoaddandmultiplytwopolynomialsandexplainwithsuitable
12 example.(7) BTL-3 Analyze
ii. What are the ways to insert a node in linked list? Write an algorithm for
inserting a node before a given node in a linked list.(6)
Explain the steps involved in the following insertion operations in a singly
linked list.
13 BTL-4 Apply
i. Insert the node in the start and End.(7)
ii. Insert the node in the middle of the List(6)
14 Discuss an algorithm for linked list implementation of list. (13) BTL-2 Understand

PART – C

1 Create an algorithm to add two polynomials using linked list. (15) BTL-6 Create
Explain an algorithm to split a linked list into two sub lists containing odd
2 BTL-5 Evaluate
and
even ordered elements in them respectively. (15)
3 Analyze how to merge two sorted linked lists into a single sorted list. (15) BTL-4 Analyze
Design algorithm for various operations performed on circular linked list.
4 Extend the algorithm defined in the previous question for the doubly BTL-6 Create
linked circular list. (15)

UNIT II - LINEAR DATA STRUCTURES – STACKS, QUEUES


Stack ADT – Operations – Applications – Evaluating arithmetic expressions- Conversion of Infix to
postfix expression – Queue ADT – Operations – Circular Queue – Priority Queue – deQueue –
applications of queues.

PART – A

BT Competence
Q.No Questions
Level
1 Point out the advantage of representing stack using a linked list than array. BTL-4 Analyze
2 Point out the rules followed during the infix to postfix conversions. BTL-4 Analyze
3 Compare the working of stack and queue data structure. BTL-5 Evaluate
4 Develop an algorithm for inserting a new element into the stack. BTL-6 Create
5 What are priority queues? What are the ways to implement priority queue? BTL-1 Remember
6 List any four applications of stack. BTL-1 Remember
7 Given the prefix for an expression, write its postfix: -*-+abc/ef-g/hi BTL-2 Understand
Describe how the following "infix" expression is evaluated with the help of
8 BTL-2 Understand
stack : 5 * ( 6 + 2 ) - 12 / 4
Give the postfix and prefix forms of the
9 BTL-2 Understand
expression: A + B* (C – D) / (P – R)
10 Define double ended queue. BTL-1 Remember
11 List the applications of a queue. BTL-1 Remember
4
12 What are the applications of priority queue? BTL-1 Remember
13 What is circular queue? BTL-1 Remember
14 Circular queue is better than standard linear queue, Why? BTL-2 Understand
15 Classify the different types of queues. BTL-3 Apply
16 Illustrate the difference between a queues and linked lists with an example. BTL-3 Apply
17 Complete a routine to display the contents of queue. BTL-3 Apply
18 Analyze and write a routine to check whether the queue is full or empty. BTL-4 Analyze
19 For railway reservation the queue data structure is preferred –Justify. BTL-5 Evaluate
20 Develop an algorithm for deleting an element in a double ended queue. BTL-6 Create

PART – B

Describewithanexamplehowtoevaluatearithmeticexpressionsusingstacks.
1 (13)
BTL-1 Remember

Explain array based implementation of stacks.


2 BTL-3 Apply
(7) Explain linked list implementation of
stacks. (6)
i. Describe about stack ADT in detail.(7)
3 ii. Explain any one application ofstack.(6)
BTL-1 Remember

4 Explain the infix, prefix and postfix expressions with an example. (13) BTL-3 Apply
i. Write an algorithm to convert an infix expression to a postfix
expression.
5 BTL-5 Evaluate
Tracethealgorithmtoconverttheinfixexpression‘(a+b)*c/d+e/f”toapostfix
expression.(8)
ii. Justify the need for Infix and Postfix expression.(5)
i. Giveanalgorithmforoperationsonstackusingalinkedlist.(7)
6 ii. Discuss about addition and deletion operations performed on a circular BTL-2 Understand
queue with necessary algorithms.(6)
i. Describetheprocessofpostfixexpressionevaluationwithanexample.(7)
7 ii. Describe the process of conversion from infix expression to postfix BTL-2 Understand
expression using stack.(6)
i. Writeanalgorithmthatchecksifexpressioniscorrectlyparenthesizedusing
8 stack and illustrate with an example.(7) BTL-4 Analyze
ii. Write the function to examine whether the stack is full () or empty ().(6)
i. Describe about queue ADT in detail.(7)
9 BTL-1 Remember
ii. Explain any one application of queue with suitable example.(6)
10 Briefly describe the operations of queue with examples. (13) BTL-1 Remember
Analyze and write an algorithm to implement queue functions using arrays.
11 BTL-4 Analyze
(13)
Develop an algorithm to perform the four operations in a double
12 BTL-6 Create
endedqueue
that is implemented as an array. (13)
13 Discuss in detail about the circular queue and its implementation. (13) BTL-2 Understand
14 Illustrate the enqueue and dequeue operations on double ended queues. BTL-4 Analyze
5
(13)
PART – C
Develop the simulation using stack for the following expression
1 BTL-6 Create
conversion: 12 + 3 * 14 – (5 * 16) +7. (15)
Analyze the algorithm which implements the stack ADT. Explain any
2 BTL-4 Analyze
one applicationof stack. (15)
Assess the difference between double ended queue and circular queue.
3 Show the simulation using stack for the following expression to convert BTL-5 Evaluate
infix to postfix: p * q - (r-s/ t). (15)
Develop an algorithm to explain Priority Queue, deQueue and
4 theapplications ofqueues. (15) BTL-6 Create

UNIT-III: NON LINEAR DATA STRUCTURES TREES- GRAPHS


Binary Trees – Binary tree representation and traversals – Application of trees: – Graph and its
representations – Graph Traversals – Connected components.
BT Competence
Q.No Questions Level
PART – A
1 If the depth of the binary tree is k, the maximum number of nodes in the BTL 5 Evaluate
binary tree is 2k-1.Justify
2 For the given binary search tree, if we remove the root and replace it with BTL5 Evaluate
something from left subtree. What will be the value of the new root? Justify
your answer.

3 Define a fully binary tree.Give an example. BTL 1 Remember


4 Createa binary tree with four nodes BTL 6 Create
5 Howbinary search tree differ from binary tree? BTL 4 Analyze
6 Whatare the rules to be followed to construct a binary search tree? BTL 1 Understand
7 List the applications of trees. BTL 1 Remember
8 Whatisa complete binary tree?Giveexample with diagram. BTL 2 Understand
9 Defineheight of a tree BTL 1 Remember
10 Howto calculate the maximum number of nodes in a binary tree with depth BTL 2 Understand
k?
11 Simulatepreorder tree traversal for the following tree BTL 6 Create
6
12 Discuss with respeect to follow
wing tree: BTL 2 Understaand
a) List the sibblings for noode E.
b) Compute thhe height

13 Numbeer the follow


wing binary tree to trav
verse it in BTL 2 Understaand
i.Preordder
ii.Inordder

14 Explain why binaary search caannot be performed on a linked lisst. BTL 4 Analyze
15 How do
d you calcuulatethe in-degree and out-degree of each nodde in the BTL 3 Apply
given graph?

7
16 List out various types of graph. BTL 1 Remember
17 List out two applications of graph BTL 1 Remember
18 Illustrate the steps in the construction of adjacency matrix for the BTL 3 Apply
following graph

19 Differentiate cyclic and acyclic graph BTL 4 Analyze


20 Show that the number of edges in a complete graph of n vertices inn(n-1)/2 BTL 3 Apply
PART – B
1 Write an algorithm for preorder, inorder and postorder traversal of a BTL 1 Remember
binarytree. (13)
2 Explain the following operations on a binary search tree with BTL 4 Analyze
suitablealgorithms
i. Find a node (6)
ii. Find the minimum and maximum elements of binary search tree (7)
3 Describe representation of binary tree using arrays and linked list. BTL 1 Remember
4 Write an algorithm for inserting and deleting a node in a binary search BTL 1 Remember
tree.(13)
5 Discuss in detail the various methods in which a binary tree can BTL 2 Understand
berepresented. Discuss the advantage and disadvantage of each method (13)
6 Construct the binary search tree using following elements: BTL 5 Evaluate
35,15,40,7,10,100,28,82,53,25,3. Show diagrammatically each step of
construction of BST. (13)
7 Discuss the different traversal technique inbinary tree with BTL 2 Understand
suitablealgorithms and examples? (13)
8 Develop an algorithm to compute the shortest path using Dijkstra’s BTL 6 Create
algorithm. Validate the algorithm with suitable example. (13)
9 Describe in detail about the following representations of a graph. BTL 1 Remember
i. Adjacency Matrix (7)
8
ii. Adjacency List (6)
10 Differentiate depth-first search and breadth-first search traversal of a graph BTL 4 Analyze
with suitable examples. (13)
11 i. Write short notes on Bi-connectivity. (7) BTL 2 Remember
ii. Express different types of graphs with example. (6)
12 Explain the depth first approach of finding articulation points in a BTL 4 Analyze
connected graph with necessary algorithm.(13)
13 Illustrate depth-first search and breadth-first search traversal of a graph BTL 3 Apply
with suitable examples. (13)
14 i. Show that the maximum number of edges in a simple graph with n BTL 3 Apply
vertices is n(n-1)/2. (7)
ii. Prove that if a graph has exactly two vertices of odd degree, there must
be path joining these two vertices (6)
PART – C
1 Consider the binary search tree given below. BTL 5 Evaluate
Find the result of in-order, pre-order, and post-order traversals.
Show the deletion of the root node
Insert 11, 22, 33, 44, 55, 66, and 77 in the tree (15)

2 Create a binary search tree and Find the position of element 29 using binary search BTL 6 Create
method in an array ‘A’ given below : A = {11, 5, 21, 3, 29, 17, 2, 43} (15)
3 Given the adjacency matrix of a graph, write an algorithm to calculate the BTL 4 Analyze
in-degree and the out-degree of a node N in the graph. (15)

9
4 Consider five cities: (1) New Delhi, (2) Mumbai, (3) Chennai, (4) BTL 6 Create
Bangalore, and (5) Kolkata, and a list of flights that connect these cities as
shown in the following table.Use the given information to construct a
graph.(15)

UNIT-IV: SORTING
Selection sort-Insertion sort – Merge sort – Quick sort – Heap sort – Bubble sort- Shell sort – Radix
sort.
PART – A
BT Competence
Q.No Questions Level

1 What is sorting? BTL1 Remember

2 Defineradix sort. BTL1 Remember

3 Give the fast sorting algorithm. BTL2 Understand

4 What is meant by internal and external sorting? Give any two BTL1 Remember
examples for each type.
5 Give the time complexities of bubble sort and quick sort. BTL2 Understand

6 Listany four sorting techniques. BTL1 Remember

7 Describe the complexity of bubble sort. BTL1 Remember

8 Predict the fastest sorting algorithm, justify. BTL2 Understand

9 Compare internal and external sorting. BTL4 Analyze

10 Distinguish which sorting technique are in-place sort and which are not. BTL2 Understand

11 Classify the different sorting methods. BTL3 Apply


10
12 Develop an algorithm for a quick sort. BTL6 Create

13 Which sorting technique is best and illustrate with an example? BTL3 Apply

14 Summarize the shell sort. BTL5 Evaluate

15 Point out the advantages of using quick sort. BTL4 Analyze

16 Compare the internal and external sorting techniques. BTL4 Analyze

17 Select the best sorting method out of the following - insertion sort, BTL5 Evaluate
quick sort and merge sort and give justification.
18 Illustrate the time complexity of insertion sort with an example. BTL3 Apply

19 Identify the advantage of shell sort over insertion sort. BTL1 Remember

20 Develop a simple algorithm for bubble sort. BTL6 Create

PART – B
Describehowtheisimplemented (13)
1 BTL1 Remember
Describe the algorithm to sort the following array: 77, 33, 44, 11, 88, 22,
2 66, 55 BTL1 Remember
i. Insertion sort(7)
ii. Shell Sort(6)
i. List the different types of sorting techniques?(7)
3 BTL1 Remember
ii. Explain any one sorting technique in detail with an Example.(6)
i. Write algorithm for merge sort.
4 (7) BTL2 Understand
ii. Discuss the running time of Divide-and-Conquer Merge sort
algorithm.(6)
i. Sort the sequence 3, 1, 4, 1, 5, 9, 2, 6, 5 usingInsertion sort. (7)
5 BTL2 Understand
ii. Describe the routine for insertion sort.(6)
Writeanalgorithmtosortasetof‘N’numbersusingquicksort.Demonstrate
6 BTL3 Apply
quick sort for the followingdata:88,11,22,44,66,99,32,67,54,10.

(13)
7 Explain Quicksort in detail with an example. (13) BTL4 Analyze
Compare the below different Sorting methods and discuss about each
8 method in a very detailed Manner. BTL4 Analyze
i. Bucket Sort.(7)
ii. Selection Sort.(6)
i. Sort the given integers and Explain the intermediate results using shell
9 sort: 35,12,14,9,15,45,32,95,40,5. (7) BTL5 Evaluate
ii. Write and explainaalgorithm to sort an integer array.(6)
i. Create a algorithm to perform a insertion sort.(7)
10 BTL6 Create
ii. Develop an algorithm for Merge sort with anexample.(6)
i. Write short notes on BubbleSort.(5)
11 BTL4 Analyze
ii. Illustrate an algorithm to sort the elements using bubble sort.(8)

11
Describe the following sorting techniques in detail with an example.
12 i. Shell sort. (7) BTL1 Remember
ii.Radix sort. (6)
i. Explain bubble sort. Sort the following numbers using bubble sort
13 BTL3 Apply
35,12,14,9,15,45,32,95,40,5(9)
ii. Explain the radix sort.(4)
Describe quick sort with algorithm. Explain thetime complexity of
14 BTL2 Understand
quicksort (13)
PART – C
1 Develop an algorithm for quick sort and explain with suitable example Give
BTL6 Create
its worst case, average case and best case time complexities.(15)
2 Analyze how to sort an integer array using Selection Sort and Radix BTL4 Analyze
Sort.(15)
3 Explain an algorithm for Shell Sort and Merge Sort and explain
BTL5 Evaluate
withexample.(15)
4 Prepare a quick sort algorithm and explain with suitable example Give its
BTL6 Create
worst case, average case and best case time complexities.(15)

UNIT-V: SEARCHING AND INDEXING


Linear Search – Binary Search - Hash tables – Overflow handling – Hash Index – B-Tree Indexing.
PART – A
BT Competence
Q.No Questions Level
1 What is hashing? BTL1 Remember

2 Define extendible hashing. BTL1 Remember


3 Give the fastest searching algorithm. BTL2 Understand

4 What is hash function? BTL1 Remember


5 Give example for hash function. BTL2 Understand
6 Name the applications of linear each technique. BTL1 Remember
7 Name the applications of binary search techniques. BTL1 Remember
8 Predict the fastest, justify. BTL2 Understand
9 Point out the procedure for select good hash function. BTL4 Analyze
10 Distinguish between linear and binary search technique. BTL2 Understand
11 Classify the different hashing techniques. BTL3 Apply

12 Develop an algorithm linear search. BTL6 Create

13 Which hashing technique is best and illustrate with an example? BTL3 Apply

14 Summarize the open addressing hashing method with an example. BTL5 Evaluate
15 Point out the advantages of using binary search. BTL4 Analyze
16 Compare the working of linear and binary search techniques. BTL4 Analyze

12
17 Does a B tree have disadvantage? Justify. BTL5 Evaluate

18 How do you calculate the depth of a B-Tree? BTL3 Apply


19 List out the various operations that can be performed on B-trees BTL1 Remember
20 Develop a simple algorithm for a binary search. BTL6 Create
PART – B
1 Describehow the divide and conquer technique is implemented in binary BTL1 Remember
search. (13)
Describe the following search algorithms to searchthe number 88 from the
2 following array: 77, 33, 44, 11, 88, 22, 66, 55 BTL1 Remember
i. Linear Search (7)
ii. Binary Search (6)
3 i, List the different types of hashing techniques? (7) BTL1 Remember
ii, Explain them in detail with an Example. (6)
i, Interpret the result of inserting the keys 2, 3, 5, 7, 11, 13, 15, 6, 4 into an
4 initially empty extendible hashing data structure with M = 3. BTL2 Understand
(7)
ii. Discuss the points to be followed in selecting a hash function. (6)
5 i. Search the element 2 from the sequence 3, 1, 4, 1, 5, 9, 2, 6, 5 using BTL2 Understand
Binary search.(7)
ii. Describe hash tables. (6)
6 Write a hash function to index a set of ‘N’ numbers and BTL3 Apply
demonstratehashingfor the following data: 88,11,22,44,66,99,32,67,54,10.
(13)
7 Explain various collision resolution techniques in detail with an example. BTL4 Analyze
(13)
Compare the below different Hashing methods and discuss about each
8 method in a very detailed Manner. BTL4 Analyze
i.Static Hashing. (7)
ii. Dynamic Hashing .(6)
i. Index the following keys using B Tree Indexing:
9 35,12,14,9,15,45,32,95,40,5. (7) BTL5 Evaluate
ii. Writethemethod to find the element 45 using the B Tree. (6)
10 i. Create an algorithm to perform a binary Search. (7) BTL6 Create
ii. Develop a hash function and demonstrate hashing.(6)
11 i. Write short notes on Hash Tables.(5) BTL4 Analyze
ii. Illustrate rehashing. (8)
Describe the following collision resolution techniques in detail with an
12 example. BTL1 Remember
i.Separate chaining. (7)
ii.Rehashing. (6)
13 i. Explain different hashing technique. (5) BTL3 Apply
ii. Explain the rehashing technique with suitable example. (8)
14 Describe the open addressing and chaining methods of collusion resolution BTL2 Understand
techniques in hashing. (13)

PART – C

13
1 Develop an algorithm to search a number in a given set of numbers using BTL6 Create
binary
search. Develop and algorithm to explain Extendible Hashing.(15)
2 Explaining the following with example
BTL5 Evaluate
i. Hashing (3)
ii. Hash function (4)
iii. Hash Table (3)
iv. Bucket overflow (5)
3 Explain B Tree with example. Analyze the advantages and disadvantages
BTL5 Evaluate
of B Tree. (15)
4 i. Develop an index using a B Tree and explain the index can be used to BTL6 Create
search an element. (8)
ii. Explain various collision resolution techniques. (7)

14

You might also like