DSA Model Question 3
Published by: Anil K. Panta
Group A
Very Short Answer Questions
Attempt all the questions. Give your answer in few lines. [10*2=20]
Define Data structure. List its types.
What is an algorithm and recursion?
Write down four applications of stack.
List two common operations performed on linked lists.
How do AVL trees maintain balance?
What is the key difference between internal and external sorting?
What is a collision and rehashing in hashing?
Define BFS and DFS.
What is Big O and Omega notation?
Define Divide and Conquer.
Section “B”
Descriptive Answer Questions
Attempt any 5 questions. Give your answer in few lines. [5*10=50]
What is time and space complexity? Explain different types/classification of data structure with examples.
Write an algorithm to convert and infix to postfix. Convert following infix to prefix expression.
((A-(B+C))*D)^(E+F)
Explain the drawback of Linear queue. Write a program in C to insert and delete data in a circular queue.
Sort the following data using a quick sort algorithm.
50, 40, 60, 35, 45, 55, 70, 30, 38, 42, 48, 53, 57, 65
Explain insertion sort with suitable examples.
Implement the simple hash function in C code where h(x) = x%10.
What is an AVL tree? Construct an AVL tree from the given data. 15,20,24,10,13,7,30,36,25
and show deletion of 7.
Section C
Attempt any two questions. [2×15=30]
A. Define the terminologies: [5]
i. Undirected graph
ii. Double Linked List
iii. Rehashing
iv. Minimum Spanning Tree
v. Binary Search
B. Define MST. Find the shortest path from A to F using Dijkstra algorithm. [10]
Define singly linked list. Write full code used to perform the following operation in a single linked list:
To delete a new node at the end of the list [5]
To insert a first node from the list. [5]
To display the data from the linked list. [5]
Given input {31,53,13,59,54,9,79} and a hash function H(x)=x (mod 10)
Separate chaining [5]
Double Hashing [10]
Second hash function H(x)=7-(x) Mod 7