Data Structures
Data Structures
DEPARTMENT OF
COMPUTER SCIENCE ANDENGINEERING
QUESTION BANK
V SEMESTER
Regulation – 2019
Prepared by
1
SRM VALLIAMMAI ENGINEERING COLLEGE
(An Autonomous Institution)
SRM Nagar, Kattankulathur-603203
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
QUESTION BANK
PART – A
BT Competence
Q.No Questions Level
1 What is Circular list? Give an example with diagram. BTL-1 Remember
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)
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
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
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
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
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
10 Distinguish which sorting technique are in-place sort and which are not. BTL2 Understand
13 Which sorting technique is best and illustrate with an example? BTL3 Apply
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
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)
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
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