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

BCA-II_CN121 Introduction to Data Structures_Theory Tutorial

The document outlines the course CN121: Introduction to Data Structures, detailing its prerequisites, credits, and class schedule. It includes a comprehensive list of theoretical questions and practical exercises across multiple modules, covering various data structures, algorithms, and their complexities. The content is aimed at Bachelor of Computer Applications students in their second semester.

Uploaded by

wnlfalcon77
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

BCA-II_CN121 Introduction to Data Structures_Theory Tutorial

The document outlines the course CN121: Introduction to Data Structures, detailing its prerequisites, credits, and class schedule. It includes a comprehensive list of theoretical questions and practical exercises across multiple modules, covering various data structures, algorithms, and their complexities. The content is aimed at Bachelor of Computer Applications students in their second semester.

Uploaded by

wnlfalcon77
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Course Code: CN121

Course Title: Introduction to Data Structures


Pre-requisite(s): Concepts of Programming Languages
Co- requisite(s): Data Structure Lab
Credits: 4 L:3 T:1 P:0
Class schedule per week: 04
Class: BCA Semester / Level: II/2
Branch: Bachelor of Computer Applications
Teacher: Santosh Kumar Agarwal

Theory Tutorial

MODULE-1
Q1. Discuss the Data Structure. Explain different types of Data Structure in detail.
Q2. Discuss the major data structures used in the following areas : RDBMS, Network data model &
Hierarchical data model. ?
Q3.How can you define algorithms? Discuss structure and properties of algorithms.
Q4. How does one measure the efficiency of algorithms? Distinguish between best, worst and average case
complexities of an algorithm.
Q5. What is asymptotic notation? Define O, Ω and Θ notations of time complexity.
Q6. What is Time and Space complexity? Discuss in brief complexity of an algorithm.
Q7. Compare and contrast exponential time complexity with polynomial time complexity.
Q8. Analyze the time complexity of the following program:
for send = 1 to n do
for receive = 1 to send do
for ack = 2 to receive do
Message = send – (receive + ack);
end
end
end
Q9. Solve the recurrence relation:
S(n) = 2 • S(n – 1) + b • n, if n > 1
= a, if n = 1
Q10. What do you mean by Array? Describe the storage structure of Array. Explain various types of Array in
detail.
Q11. Consider the base address of an boolean array to be 1048. Find the address of the element at index = 5.
(Indexing is 0 based)
Q12. Distinguish between row major and column major ordering of an array.
Q13. Consider an integer array of size 3X3. The address of the first element is 1048. Calculate the address of
the element at index i = 2, j = 1. (0 based index)
Q14. Given the base address of an array A[1300 ………… 1900] as 1020 and the size of each element is 2
bytes in the memory, find the address of A[1700].
Q15.Consider the linear arrays AAA(5:50), BBB (-5:10) and CCC(18).
1
(a) Find the number of elements in each array
(b) Suppose Base(AAA) = 300 and w=4 words per memory cell for AAA. Find the address of AAA[15],
AAA[35] and AAA[55]
Q16. To find the address of any element in 3-Dimensional arrays there are the following two ways-
a. Row Major Order b. Column Major Order
Q17. Given an array, arr[1:9, -4:1, 5:10] with a base value of 400 and the size of each element is 2 Bytes in
memory find the address of element arr[5][-1][8] with the help of row-major order?
Q18. For an n-dimensional array [1 : u1, 1: u2, … 1 : un] obtain the address of the element A[i1, i2, i3, … in] given
β to be the home address.
Q19. Declare a one, two and a three-dimensional array in a programming language ( C/C++) which has the
capability to display the addresses of array elements. Verify the various address calculation formulae for any
arbitrary element of these arrays.
Q20.What are the limitations of arrays? How can you overcome the limitations of arrays?
Q21. What is Stack? Why it is known as LIFO? Write algorithm of PUSH, POP and PEEP operation on Stack.
Q22. For the following logical expression: ( a and b and c) or d or e or (not h)
(i) Obtain the equivalent postfix expression.
(ii) Evaluate the postfix expression for a = true, b = false, c = true, d = true, e = true, h = false.

Q23. Implement a stack S of n elements using arrays. Write functions to perform PUSH and POP operations.
Implement queries using push and pop functions to
a. Retrieve the mth element of the stack S from the top (m < n), leaving the stack without its top m – 1
elements.
b. Retain only the elements in the odd position of the stack and pop out all even positioned elements.
Q24. Write a recursive program to obtain the nth order Fibonacci sequence number. Include appropriate
input/output statements to track the variables participating in recursion.
Q25.Translate infix expression into its equivalent post fix expression: (A-B)*(D/E)
Q26. Implement a program to evaluate any given postfix expression. Test your program for the evaluation of
the equivalent postfix form of the expression ( - (A*B)/D) ↑ C + E – F * H * I for A = 1, B = 2, D = 3, C = 14,
E = 110, F = 220, H = 16.78, I = 364.621.
Q27. Translate infix expression into its equivalent post fix expression: (A+B^D)/(EF)+G
Q28.Translate infix expression into its equivalent postfix expression: A*(B+D)/E-F*(G+H/K)
Q29. Convert following Infix expression into Postfix expression using Tabular method: a – b / c * d + e * f / g
Q30. Consider the following arithmetic expression P, written in postfix notation:
P: 12 , 7 , 3 , - , / , 2 , 1 , 5 , + , * , +. Translate P into infix expression.
Q31. Evaluate P: 12 , 7 , 3 , - , / , 2 , 1 , 5 , + , * , + , )
Q32. What is Recursion? Explain Recursion for find a factorial of number in detail.
Q33. List the applications of Stack. What is the data structures used to perform recursion?
Q34. Write an algorithm for converting Parenthesized Infix expression into Postfix expression.
Q35.Consider the following stack of characters, where STACK is allocated N = 8 memory cells STACK :
A,C,D,F,K,_,_,_. ( _ means empty allocated cell). Describe the stack as the following operations takes place:
(a) POP(STACK, ITEM)
(b) POP(STACK, ITEM)
(c) POP(STACK, ITEM)
(d) PUSH(STACK, R)
2
(e) PUSH(STACK,L)
(f) PUSH(STACK, S)
(g) PUSH(STACK,P)
(h) POP(STACK, ITEM)
Q36. What is the difference between a queue and a stack?
Q37.What is Queue? Why it is known as FIFO? Write an algorithm to insert and delete an element from a
simple Queue.
Q38. What are the disadvantages of the linear queues? How do circular queues help overcome the
disadvantages of linear queues?
Q40. What is Circular Queue? Write an algorithm to insert and delete an element from a C.Q.
Q41. What is Priority Queue? Minimum number of queues needed to implement priority queue
Q42. Let PQUE be a priority queue data structure and a(1p 1) , a(2p 2), a(np n ) be n elements with priorities pi ( 0 ≤ pi ≤
m – 1). Implement PQUE as a two dimensional array ARR_PQUE[1:m, 1:d] where m is the number of priority
values and d is the maximum number of data items with a given priority. Execute insertions and deletions
presented in a random sequence.
Q43. What is DQueue? Write an algorithm to insert and delete an element from a DQueue.

MODULE-2
Q44. What is a linked list? What is the difference between an array and a linked list?
Q45. What is a node? What does node consist of? Write the syntax of node creation?What is the use of a head
node in a linked list?
Q46.What are the conditions for testing a linked list T is empty, if T is a (i) Simple singly linked list (ii) headed
singly linked list (iii) Simple circularly linked list and (iv) headed circularly linked list?
Q47. How do you create an empty linked list? Write an algorithm to insert and delete a node and traverse
Linked List.
Q48. What are the advantages of circular lists over singly linked lists?
Q49. What are the advantages and disadvantages of doubly linked lists over singly linked lists?
Q50. What is Circular Linked List? State the advantages and disadvantages of Circular Link List
Q51. What is Doubly Linked List? Write an algorithm to insert and delete a node in Doubly Linked List.
Q52. Demonstrate the application of singly linked lists for the addition of the polynomials P 1 and P2 given
below:
P1: 19x6 + 78x4 + 6x3 – 23x2 – 34
P2: 67x6 + 89x5 – 23x3 – 75x2 – 89x -21
Q53. Let X = (x1, x2, … xn), Y = (y1, y2, …yn) be two lists with a sorted sequence of elements. Write a program
to merge the two lists together as a single list Z with m + n elements. Implement the lists using singly linked list
representations.
Q54. Write a program which will split a circularly linked list P with n nodes into two circularly linked lists P1,
P2 with the first ⌊ n/2 ⌋ and the last n - ⌊ n/2 ⌋ nodes of the list P in them, respectively.
Q55. What are the merits of linked stacks and queues over their sequential counterparts?
Q56. How is the memory storage pool associated with a linked stack data structure for its operations?
Q57. How are push and pop operations implemented on a linked stack?
Q58. How are Insertion and Deletion operations implemented on a linked queue?

3
MODULE-3
Q59.What is Binary Tree? Explain Representation of Binary tree. Also explain different operation that can be
performed on Binary tree.
Q60. What are complete trees? Draw a binary Tree for the expression : A * B - (C + D) * (P /Q)
Q61. Explain In-order, Pre-order and Post-order Traversal operation on Binary tree with example.
Q62. For the following COBOL code, draw the Binary tree?
01 STUDENT_REC.
02 NAME.
03 FIRST_NAME PIC X(10).
03 LAST_NAME PIC X(10).
02 YEAR_OF_STUDY.
03 FIRST_SEM PIC XX.
03 SECOND_SEM PIC XX.
Q63.Traverse the given tree using Inorder, Preorder and Postorder traversals.

Q64.In the given binary tree, using array you can store the node 4 at which location?

Q65. Given the following in-order and pre-order traversals, trace the binary tree. In-order traversal: B F G H P
R S T W Y Z Pre-order traversal: P F B H G S R Y T W Z.
Q66. List the types of Binary Search Tree. Explain Insertion and Deletion Operation on Binary Search Tree
with Example.
Q67. What is the meaning of height balanced tree? How rebalancing is done in height balanced tree?
Q68. Construct a tree for the given in-order and post-order traversals. In-order : DGBAHEICF Post-order :
GDBHIEFCA
Q69. Discuss following with reference to trees. (i) Height of the tree (ii) Complete Binary Tree (iii) Expression
tree (iv) Sibling (v) Full Binary Tree
Q70. Create a Binary Search Tree for the following data and do in-order, Pre-order and Post-order traversal of
the tree. 50, 60, 25, 40, 30, 70, 35, 10, 55, 65, 5

4
Q71. Define an AVL tree. Obtain an AVL tree by inserting one integer at a time in the following sequence. 150,
155, 160, 115, 110, 140, 120, 145, 130, 147, 170, 180. Show all the steps.
Q72. Draw the B-tree of order 3 created by inserting the following data arriving in sequence - 92 24 6 7 11 8 22
4 5 16 19 20 78
Q73. What is Hashing? Explain Different Hash function method in detail. Explain each one.
Q74. What is an m-way search tree? What are the merits of m-way search trees over AVL search trees? What
are the demerits of m-way search trees?
Q75. What is the need for B trees? What is the height of a B tree of order m?
Q76. Insert the following elements in the order given into an empty B tree of order (i) 3 (ii) 4 and (iii) 7: Z R T
A D F H Q W C V B S E O P L J K M N U T X.
Undertake the following operations on the B trees: (i) delete Q (ii) delete A (iii) delete M
Q77. For the data list given in Question 69, construct a 3-way search tree. Insert G and delete J K and Z from
the search tree.

MODULE-4
Q78. Discuss following with reference to graphs. (i) Directed graph (ii) Undirected graph (iii) Degree of vertex
(iv)Null graph (v) Acyclic Graph.
Q79. For a graph of your choice, trace its (i) adjacency matrix and (ii) adjacency list representations.
Q80. How can graph traversal procedures help in detecting graph connectivity?
Q81. Draw graphs that contain (i) an Eulerian walk and (ii) a Hamiltonian circuit.
Q82. Explain Breadth First Search and Depth First Search traversal of Graph using an example.
Q83. For the given graph, draw the DFS and BFS?

Q84.Convert the given graph with weighted edges to minimal spanning tree.

Q85. What is Spanning Trees? Explain Spanning Tree in detail with example.
Q86. What is a minimum spanning tree? Discuss an algorithm for finding minimum cost spanning tree.
Q87. Implement Dijkstra’s algorithm to obtain shortest path from a given source vertex (of your choice) to
every other vertex of a graph of your choice which must at least 10 nodes with 5 cycles.
Q88. Explain Djiksatras algorithm. Give mode of operation in Dijkstra's algorithm .
Q89.What does Kruskals’s algorithm do? Explain Kruskals’s algorithm

5
Q90. List the steps to construct a forest.
Q91. Explain greedy algorithm.

MODULE-5
Q92. What are partitions?
Q93.What is sorting? Distinguish between internal sorting and external sorting. List some popular sorting
methods.
Q94. What is the principle behind Shell sort? Explain the procedure for shell sort.
Q95. Explain bubble sort. Explain the procedure for bubble sort.
Q96. What is insertion sort? Explain the procedure for insertion sort. What is the complexity of insertion sort?
Sort 20,35,40,100,3,10,15 using insertion sort.
Q97. What is quicksort algorithm? What is the complexity of quicksort algorithm?
Q98. Sort the given values using Quick Sort? 65 70 75 80 85 60 55 50 45
Q99. What is merge sort? Explain the procedure of merge sort.
Q100. What is selection sort? Write the process of selection sort. What is the complexity of selection sort?
Sort: 20,35,40,100,3,10,15
Q101. What is a heap?
Q102.When is a transpose sequential search said to be most successful?
Q103. What is the principle behind interpolation search?
Q104. What do you mean by Searching? Explain and write an algorithm Sequential search with help of
example.
Q105. What do you mean by Binary Search? What are the advantages of binary search over sequential search?
Q106. Explain and write an algorithm Binary search with help of example.

You might also like