Question Bank
Subject: Data Structure and Applications Class: AIDS
Subject code: BCS304 Faculty: Mrs. Jyothi R
Course Outcomes
CO 1. Explain different data structures and their applications.
CO 2. Apply Arrays, Stacks and Queue data structures to solve the given problems.
CO 3. Use the concept of linked list in problem solving.
CO 4. Develop solutions using trees and graphs to model the real-world problem.
CO 5. Explain the advanced Data Structures concepts such as Hashing Techniques and Optimal
Binary Search Trees
MODULE 1
Sl. Questions CO
No.
Topic: Introduction
1. Define Data structures. Classify the data structures with examples. And explain CO1
the operations of Data structures
Topic: Pointers
2 Define Pointers and Pointer Variable. How to declare and initialize pointers in C, CO1
explain with examples,
3 Can we have multiple pointers to a Variable? How pointers can be dangerous CO1
Topic: Dynamic Memory Allocation
4
Explain four dynamic memory allocation functions with S ynt ax a nd CO1
examples
Topic: Arrays
5 What is array? Give Abstract data type (ADT) for array. How array are CO2
declarations and implemented in C
6 Write a basic C program to demonstrate the basic operations of Array CO2
7 Write a C program to read and display two dimensional array by using Dynamic CO2
memory allocation
Topic: Structures and Unions
8 What is structure? Explain various operations that can be performed on structures. CO1
9 How does a structure differ from a union? Explain with example. CO1
10 How to declare user defined datatype using structures with an example CO1
program.
11 What is self-referential structures? Explain with example. CO1
Topic: Polynomials
12 What is a polynomial? Apply ADT to represent two polynomials and write a CO1
function to add the polynomials.
13 Write addition of polynomial using arrays of structures. CO1
A(x)= 3x23 + 3x4 + 4x2 + 15.
B(x)= x5 + 20x3+ 2.
Solve by explaining all 3 cases.
Topic: Sparse Matrix
14 CO1
Define sparse matrix. E x p l a i n i t s representation with its ADT.
15 CO1
Write a function to read a sparse matrix and transpose a sparse matrix. Explain with
example.
Topic:
Strings
16 CO1
Define strings. Explain any four string handling functions supported by ‘C’ with
syntax and example
17 CO1
Write the ADT of strings
18 CO1
Define pattern Matching. Write the Knuth Morris Pratt pattern matching algorithm
and apply same pattern ‘abcdabcy’ in the text: ‘abcxabcdabxabcdabcdabcy’
19 CO1
Write a function to insert a string into another string at position ‘i’ and explain with
example.
20 CO1
Explain nfind string matching algorithm and find a pattern “aab” in the string
“ababbbaabaa”.
Topic:
Stacks
21 CO2
Give Abstract datatype(ADT) of Stack
22 CO2
Define Stack. Explain the different operations that can be performed on stack with
suitable ‘C’ functions and explain
23 CO2
Convert the following infix expression into postfix expression using stack 1. A + (
B*C-(D/E^F)*G)*H
2. ( ( H * ( ( ( ( A + ( ( B + C ) * D ) ) * F ) * G ) * E ) ) + J )
3. A * ( B + D ) / E – F * ( G + H / K )
24 CO2
Write an algorithm to evaluate a postfix expression. Trace the algorithm for the
expression showing the stack contents
6 5 1 – 4 * 2 3 ^ / +.
546+*493/+*
Question Bank
Subject: Data Structure and Applications Class: AIDS
Subject code: BCS304 Faculty: Mrs. Jyothi R
Course Outcomes
CO 1. Explain different data structures and their applications.
CO 2. Apply Arrays, Stacks and Queue data structures to solve the given problems.
CO 3. Use the concept of linked list in problem solving.
CO 4. Develop solutions using trees and graphs to model the real-world problem.
CO 5. Explain the advanced Data Structures concepts such as Hashing Techniques and Optimal
Binary Search Trees
MODULE 2
Sl. Questions CO
No.
Topic: Queues, Circular Queues, Using Dynamic Arrays, Multiple Stacks and queues
1. Define Queue. Write QINSERT, QDELETE and QDISPLAY procedures for CO2
queues using arrays
2 Develop a C function to implement insertion, deletion and display operations of CO2
circular queue
3 Explain the ADT of Queue with its functions CO2
4 Implement circular queue using dynamic arrays CO2
5 Write C program to demonstrate multiple stacks and queues CO2
Topic: Singly Linked, Lists and Chains, Representing Chains in C, Linked Stacks and
Queues, Polynomials
6 Differentiate between array and Linked list CO3
7 Develop a C functions to implement using Single linked list CO3
1)Insert and Delete node from front
2) Insert and Delete node from rear end
3)Display/ printing the contents
8 Develop a C program to implement all Stack operations using Linked list CO3
9 Develop a C program to implement all Queue operations using Linked list CO3
10 Write C function to add two polynomials using Single linked list CO3
11 Write C function to add two polynomials using Circular linked list CO3
Question Bank
Subject: Data Structure and Applications Class: AIDS
Subject code: BCS304 Faculty: Mrs. Jyothi R
Course Outcomes
CO 1. Explain different data structures and their applications.
CO 2. Apply Arrays, Stacks and Queue data structures to solve the given problems.
CO 3. Use the concept of linked list in problem solving.
CO 4. Develop solutions using trees and graphs to model the real-world problem.
CO 5. Explain the advanced Data Structures concepts such as Hashing Techniques and Optimal
Binary Search Trees
MODULE 3
Sl. Questions CO
No.
Topic: LINKED LISTS: Additional List Operations, Sparse Matrices, Doubly Linked List
1. Develop a C function to Invert/Reverse a Single linked list using example CO3
2 Develop a C function to Concatenate single linked list CO3
3 Show diagrammatic linked representation for the following sparse matrix CO3
0 1 2 0 0 3 0 4 0 0 4 0 0 3 0 0 0
3 0 3 0 0 5 7 0 6 5 0 0 0 5 0 0 6
0 0 0 0 0 0 0 0 0 3 0 1 0 0 0 0 0
0 2 6 0 0 0 0 0 0 2 4 0 0 8
0 0 9 0
4 Differentiate Single Linked List(SLL) and Double Linked List(DLL) CO3
5 Write C program to develop Double linked list with following functions CO3
1)Insert a node at front end of the list
2)Delete a node from front end of the list
3)Display
6 Write C program to develop Double linked list with following functions CO3
1)Insert a node at rear end of the list
2)Delete a node from rear end of the list
3)Searching a node with given key value
7 Write C program to develop Double linked list with following functions CO3
1)Insert a node at specific location of the list
2)Delete a node from specific location of the list
8 Write a C program to represent and add two polynomials using singly circular CO3
linked list
Topic: TREES: Introduction, Binary Trees, Binary Tree Traversals, Threaded Binary Trees
9 Define Tree. With the examples explain the terminologies of tree. CO4
10 Explain the representation of trees CO4
11 What is Binary tree and explain its properties with proof CO4
12 CO4
Taking a binary tree as example show the representation of binary tree with both
array and linked list ways.
13 CO4
Write a C functions for of binary tree.
14 CO4
Consider a following tree T write Inorder, Preorde and Postorder traversals along
with its functions.
A
B C
D E G H
J K
15 CO4
Explain five types of Binary tree
16 CO4
Explain the Threaded Binary trees along with function for insertion and inorder
traversal
Question Bank
Subject: Data Structure and Applications Class: AIDS
Subject code: BCS304 Faculty: Mrs. Jyothi R
Course Outcomes
CO 1. Explain different data structures and their applications.
CO 2. Apply Arrays, Stacks and Queue data structures to solve the given problems.
CO 3. Use the concept of linked list in problem solving.
CO 4. Develop solutions using trees and graphs to model the real-world problem.
CO 5. Explain the advanced Data Structures concepts such as Hashing Techniques and Optimal
Binary Search Trees
MODULE 4
Sl. Questions CO
No.
1. Draw a binary serach tree for the following input of elements CO4
40 10 79 90 12 54 11 9 50 and also write a Recursive Search function for
Binary Search tree
2. Construct a Binary tree by using the following in-order and preorder traversal CO4
Inorder: BCAEDGHFI
Preorder: ABCDEFGHI
3. Write a Recursive Search and Iterative Search function for Binary Search tree CO4
4. Write a function to perform Delete from BST and Insert an element into BST and CO4
explain with example
5. Construct a Binary tree by using the following in-order and preorder traversal CO4
Inorder: 42516738
Preorder: 45267831
6. Write a function to find CO4
i) Maximum element in BST
ii) Minimum element in BST
iii) Height of BST
iv) Count the no of nodes in BST
v) count the no of leaf nodes in BST
7. Write short notes on: CO4
i) Transforming a Forest into a Binary Tree
ii) Forest Traversals.
iii) Selection Tress
iv) Array and linked representation of binary trees
8. Construct a Binary tree by using the following in-order and preorder traversal CO4
Inorder: EACKFHDBG
Preorder: FAEKCDHGB also perform postorder traversal of the obtained tree
9. Draw a binary serach tree for the following input of elements CO4
14, 15, 4, 9, 7, 18, 3, 5, 16, 20 and also perform Inorder, Preorder and Postorder
Traversal
Graph
10. Define Graph. For a graph shown in figures show the adjacency matrix and CO4
adjacency list representation for all three.
11. Define the terminologies with examples CO4
i)Diagraph
ii)Weighted graph
iii)Self Loop
iv)Parallel edges
v)Multi Graph
vi)Complete graph
12. Design a C Program for the following operation on Graph(G) of cities: CO4
i)Create a graph of N cities using Adjacency matrix
ii)Print all the nodes reachable from the given starting node in the digraph using
BFS/DFS method
13. Write the algorithm for BFS and DFS CO4
14. Show BFS and DFS traversal for the following graph. CO4
Question Bank
Subject: Data Structure and Applications Class: AIDS
Subject code: BCS304 Faculty: Mrs. Jyothi R
Course Outcomes
CO 1. Explain different data structures and their applications.
CO 2. Apply Arrays, Stacks and Queue data structures to solve the given problems.
CO 3. Use the concept of linked list in problem solving.
CO 4. Develop solutions using trees and graphs to model the real-world problem.
CO 5. Explain the advanced Data Structures concepts such as Hashing Techniques and Optimal
Binary Search Trees
MODULE 5
Sl. Questions CO
No.
1. What is Hashing? What are the two criteria, a good hash function should satisfy? CO5
2. List and explain the types of Hash functions with example
3. Explain how Hashing table is constructed
4. Explain all the steps for creation of hash function using C functions. CO5
5. What is collision? Explain the two techniques for avoiding the collision with
example.
6. Write a C program to create a Hash table and insert the keys and avoiding the CO5
collision using Linear Probing method.
7. CO5
Write a C program to create hash table and to search for key
8. Dynamic hashing using directories with the provided example of identifiers and CO5
their binary representations
9.
Explain Static and Dynamic Hashing in detail.
10. CO5
Define and explain Leftist tree.
11.
Explain with example Height biased Leftist tree(HBLT) and Weight Biased Leftist
tree(WBLT)
12. Let n=4 and (a1,a2,a3,a4)=(10,15,20,25). Let (p1,p2,p3,p4)=(3,3,1,1) and CO5
(q0,q1,q2,q3,q4)=(2,3,1,1,1). The p’s and q’s have been multiplied by 16 for
convenience. Obtain the optimal binary search tree(OBST). And also write C
function to find OBST.