Data Structure MRQTotal

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

S. S.

A GRA WA L I NSTITUTE OF E NGI NE ERING & T E CHNOLOGY , N AV SARI


COMPUTER DEPARTMENT
SEMESTER -VII

Question Bank (Most Repeated Questions)

Subject: Data Structure [3130702]

Ch-1 Introduction
Sr. No. Questions

1. Differentiate between data types and data structures.


2. Explain primitive and Non-primitive data types in detail.
3. What is time complexity? Explain with example.
4. What do you mean by time and space complexity of an algorithm?
5. Explain with examples. Linear and Non-Linear Data Structures.
6. What do you mean by Abstract Data Types?
Write short note on performance analysis and performance measurement of an
7.
algorithm.
8. Explain algorithm with its characteristics.
9. Explain primitive and Non-primitive data structures in detail.

Ch-2 Array
Sr. No. Questions

1. Explain array with its types.


2. Explain sparse matrix representation.

Ch-3 Stack
Sr. No. Questions

1. What is top of stack? Why stack is called LIFO list?


Convert the following infix expressions to their prefix and postfix equivalents.
2. 1. A*B+C/D
2. (A*B)+(C/D)-(D+E)
Evaluate the following postfix expression using stack.
3.
53+62/*35*+
4. What is stack? Explain operations on stack in detail.
5. Explain Tower Of Hanoi with example.
6. Evaluate the following postfix expression in tabular form: 3 5 * 6 2 / +
7. Write an algorithm for infix to postfix conversion.
S. S. A GRA WA L I NSTITUTE OF E NGI NE ERING & T E CHNOLOGY , N AV SARI
COMPUTER DEPARTMENT
SEMESTER -VII

Write an algorithm to evaluate postfix expression. Explain working of the


8.
algorithm using appropriate example.
9. Write a ‘C’ program to reverse a string using stack.
Write and explain algorithms, function or pseudo code for PUSH and POP operations
10.
on stack data structure.
11. Write applications of stack data structures
Evaluate the following postfix expression and show the stack trace.
12.
651–4*23^/+
Convert the following infix expressions to postfix expressions and show the stack
trace.
13.
(i) (A+B)*C+D / (E+F*G) + H
(ii) ((A/(B-C+D))*(E-F)*G)
Convert the following infix expressions to prefix expressions and show
the stack trace.
14.
(i) A*(B+C)/D-E*F^G
(ii) A+B*(C-D/E$F)*G
Write a 'C' program or an algorithm to convert infix expression without parenthesis to
15.
postfix expression.
Convert (A + B) * C – D ^ E ^ (F * G) infix expression into prefix format showing stack
16.
status after every step in tabular form.
17. Describe: (1) Recursion. (2) Factorial using recursion.
18. Write an algorithm to check if an expression has balanced parenthesis using stack.
Evaluate the following postfix expression using a stack. Show the stack contents.
19. AB*CD$-EF/G/+
A=5, B=2, C=3, D=2, E=8, F=2, G=2
Consider the stack S of characters, where S is allocated 8 memory cells.
S: A,C,D, F, K, _, _, _
20.
Describe the stack as the following operations take place.
Pop(), Pop() ,Push(L), Push(P), Pop(), Push(R), Push (S), Pop()

Ch-4 Queue
Sr. No. Questions

1. What is queue? Explain operations on queue in detail.


2. Discuss and write a program to implement queue functions using arrays.
3. Distinguish between stack and queue.
What is a circular queue? How do you check the queue full condition? Write an
4.
algorithm to count the nodes in a circular queue.
Write an algorithm to perform insert and delete operations on simple queue. Or Write
5.
an algorithm for simple queue with enqueue and dequeue operations.
6. What is priority queue? Discuss its applications and implementation details.
7. Design an algorithm to perform insert and delete operation in circular queue.
S. S. A GRA WA L I NSTITUTE OF E NGI NE ERING & T E CHNOLOGY , N AV SARI
COMPUTER DEPARTMENT
SEMESTER -VII

8. Explain advantages of circular queue over Simple queue.


9. Explain double ended queue.
10. Explain various applications of queue.
Perform following operations in a circular queue of length 4 and give the Front, Rear and
Size of the queue after each operation.
1) Insert A, B
2) Insert C
11. 3) Delete
4) Insert D
5) Insert E
6) Insert F
7) Delete

Ch-5 Linked List


Sr. No. Questions

1. Differentiate: Static and Dynamic Memory Allocation


Explain malloc and free functions in ‘C’. Also discuss advantages of
2.
dynamic over static memory allocation.
3. Array vs Linked List. Compare and Differentiate.
Write ‘C’ functions to implement INSERT_FIRST (to insert a node at the first position),
INSERT_LAST (to insert a node at the last position), DELETE_FIRST (to delete a node
4. from the first position), DELETE_LAST (delete a node from the last position) and
TRAVERSE (to display the data in nodes) operations in circular/singly/doubly linked
list.
Write an algorithm for insertion of a new node at last position in Singly
5.
Linked List.
Write an algorithm for deletion of a specific node from the Singly
6.
Linked List.
7. Write and explain algorithm for insertion and deletion in Singly Linked List.
8. Write user defined ‘C’ function to delete node from end in circular linked list.
9. Write user defined ‘C’ function to insert node at the end in circular linked list.
10. List the advantages of doubly linked list over singly linked list.
11. Explain creation, insertion and deletion of doubly linked list with example.
Write user defined ‘C’ function to delete node from a specific location in
12.
doubly linked list.
13. Write a ‘C’ program to implement stack using linked list.
14. Write a ‘C’ program to implement queue using linked list.
S. S. A GRA WA L I NSTITUTE OF E NGI NE ERING & T E CHNOLOGY , N AV SARI
COMPUTER DEPARTMENT
SEMESTER -VII

Ch-6 Tree
Sr. No. Questions

1. How can you represent a Binary Tree in memory using array?


Given Inorder and Preorder traversal, find Postorder traversal. Inorder:
2. YBKCFAGXEDHZ
Preorder: G B Y A C K F X D E Z H
What is a binary search tree? Create a binary search tree for the
3. following data. 14, 10, 17, 12, 10, 11, 20, 12, 18, 25, 20, 8, 22, 11, 23
Explain deleting node 20 in the resultant binary search tree.
Write algorithms for the inorder, preorder and postorder traversal of the
4.
binary tree.
Draw a Binary expression tree for the following and perform preorder
5.
traversal: a * ( b + c ) + ( d * e ) / f + g * h
Insert the following letters into an empty B-tree of order 5: C N G A H
6.
EKQMFWLTZDPRXYS
Define the following terms
(a) Complete binary tree (b) Leaf node (c) Height of a tree.

7. Define the following:


1. Sibling
2. Forest
3. Strictly Binary Tree
Construct a binary tree from the traversals given below:
Inorder:
8.
D, B, A, E, G, C, H, F, I
Preorder: A, B, D, C, E, G, F, H, I
9. Write a short on AVL tree.
10. Explain the concept of B-tree with suitable example and list its applications.
Construct a binary search tree from the following numbers.
11.
38, 13, 51, 10, 12, 40, 84, 25, 89, 37, 66, 95
12. Explain BFS and DFS.
Construct BST for following sequence and find inorder traversal for the same.
13.
35, 46, 29, 2, 24 ,68, 44, 57, 1, 22, 79, 71
14. Explain rotation rules for AVL Trees.
15. Explain insertion and deletion in B-tree with example.
Construct AVL tree for following sequence:
16.
10, 20, 30, 40, 50, 60, 70 ,80
For following expressions, construct the corresponding binary tree.
17. 1. A+B/C*D-E
2. ((A+B)-(C*D))%((E^F)/(G-H))
18. Design an algorithm to insert a given value in the binary search tree.
19. What are binary trees? Mention different types of binary trees with example.
S. S. A GRA WA L I NSTITUTE OF E NGI NE ERING & T E CHNOLOGY , N AV SARI
COMPUTER DEPARTMENT
SEMESTER -VII

20. What is B -tree of order m? Draw a B-tree of order 3.


21. Explain minimal spanning tree.

Ch-7 Graph
Sr. No. Questions
Define the following terms
1.
Directed graph (b) Multigraph (c) Complete graph.
2. Explain BFS vs DFS.
3. Explain Kruskal’s algorithm with suitable example.
4. Explain Prim’s algorithm with suitable example.
How are graphs represented inside a computer’s memory? Which method do you
5.
prefer and why?
6. What is a graph? Explain various representations of graphs.
7. Discuss BFS algorithm with example.
8. Define topological sort?

Ch-8 Hashing
Sr. No. Questions
Initially the following keys 10,16,11,1,3,4,23 and 15 are inserted into an
1. empty hash table of length 10. Using open addressing with hash function
h(k)=k mod 10 and a linear probing. What is the resultant hash table?
What is collision? What are the methods to resolve collision? Explain
2.
any one method to resolve collision with example.
3. List out different hash methods and explain any three.
4. Explain collision resolution techniques with example.
5. List out applications of Hashing.
Build a chained hash table of 10 memory locations. Insert the keys 131, 3, 4, 21, 61,
6.
24, 7, 97, 8, 9 in hash table using chaining. Use h(k) = k mod m. (m=10)
Consider the hash table of size 10. Using quadratic probing, insert the keys 72, 27, 36,
7.
24, 63, 81, and 101 into hash table. Take c1=1 and c2=3.
8. Explain hashing. What are qualities of a good hash function. Explain two hash functions.
Ch-9 File Structures
Sr. No. Questions

1. Define terms with respect to file: fields, records, database


2. Explain indexed file organization.
3. Explain random file organization.
S. S. A GRA WA L I NSTITUTE OF E NGI NE ERING & T E CHNOLOGY , N AV SARI
COMPUTER DEPARTMENT
SEMESTER -VII

4. Explain basic file operations.


5. Give a brief note of indexing.
6. Explain sequential file organization with its advantages and disdvantages.

Ch-10 Sorting and Searching


Sr. No. Questions

1. Write an algorithm for insertion sort.


2. Write an algorithm for selection sort.
3. Write a ‘C’ program for selection sort.
4. Compare sequential and binary search methods.
Apply quick sort for the following data:
5.
9, 7, 5, 11, 12, 2, 14, 3, 10, 6
Search the number 50 from the given data using binary search technique. Illustrate
6. the searching process.
10, 14, 20, 39, 41, 45, 49, 50, 60
7. Write a C program for bubble sort.
8. Apply merge sort algorithm to the following elements. 20, 10, 5, 15, 25, 30, 50, 35
9. Write algorithm of quick sort.
10. What do you mean by internal and external sorting.

You might also like