DS-Question Bank

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

UNIT 1

2 marks questions

1. Define data structure


2. List down different data structure operations
3. Define ADT (abstract data type)
4. What is meant by algorithm complexity
5. What is time complexity
6. What is space complexity
7. What is time space trade off
8. What is priori analysis and posteriori analysis
9. What is best case, worst case and average case analysis
10. Define an Array. How to initialize an array.
11. How to represent an array in memory
12. Explain array as an ADT
13. What are the different types of arrays.
14. What is a multidimensional array. How to initialize it
15. How a multidimensional array is represented in memory (row major, column major)
16. Define a matrix
17. Define sparse matrix.

5 marks questions

1. Define data structure. Explain classification of data structures


2. Explain different data structure operations
3. Explain the asymptotic notations used to calculate the time complexity of an algorithm.
4. Explain basic mathematical functions and notations used in algorithms
5. Explain the algorithmic notations used to write an algorithm
(Questions from 6 – 8 is equally important)
6. Write an algorithm/C program to perform traversal of a linear array
7. Write an algorithm/C program to perform insertion of an element into a linear array
8. Write an algorithm/C program to perform deletion of an element from a linear array
9. What is a sparse matrix. How a sparse matrix is represented in memory.
10. Write a C program to check whether a matrix is sparse matrix or not

UNIT 2

2 marks questions

1. Define a singly linked list


2. Explain Linked list as an ADT
3. What is self-referential structure?
4. Mention the advantages of linked list over arrays.
5. What is dynamic memory allocation.
6. How dynamic memory allocation is done in C language
7. What is Garbage collection
8. How malloc() and free() function is used in dynamic memory allocation
9. Define getNode and freeNode operations on linked list
10. Define a doubly linked list
11. Define a header linked list
12. Define a circular linked list
13. What is a sorted(linked) list
14. Define a stack
15. Explain stack as an ADT
16. Mention the operations performed on stack
17. What is polish notation of arithmetic expressions
18. What is reverse polish notation?
19. Define recursion
20. What is tower of hanoi problem
21. Define a queue
22. Explain queue as an ADT
23. List the types of Queue
24. Define circular queue
25. Define double-ended queue
26. Define priority queue
27. Mention the operations performed on queue
28. Mention the application of queue
29. Mention the application of stack

5 marks questions
1. Define a singly linked list. How it is represented in memory?
(Questions from 2 – 9 is equally important)
2. Write an algorithm/ C program to traverse a singly linked list
3. Write an algorithm/ C program to search an element in a singly linked list
4. Write an algorithm/ C program to insert an element at the end of a singly linked list
5. Write an algorithm/ C program to insert an element at the beginning of a singly linked list
6. Write an algorithm/ C program to insert an element at a particular position in the singly
linked list
7. Write an algorithm/ C program to delete an element from the end of a singly linked list
8. Write an algorithm/ C program to delete an element from the beginning of a singly linked list
9. Write an algorithm/ C program to delete an element from a particular position of a singly
linked list
10. Write an algorithm/ C program to insert an element into an ordered singly linked list
11. Explain different types of linked list
12. Explain different memory representation of stacks(array representation and linked list
representation)
13. Write algorithm/C program to convert infix expression to postfix expression
14. Convert infix to postfix expression using stack A + (B * C – (D/E ^ F)* G) * H
15. Write algorithm/C program to perform postfix evaluation
16. Evaluate the postfix expression using stack 6,3,+,5,*,2,3,+,+
17. Explain 2 applications of Stacks
18. What is recursion. How Stack data structure is used in recursive programming. Explain with
an example
19. Explain Tower of Hanoi problem and its solution with an example .(write algorithm as well)
20. Write a C function for solving Tower of Hanoi Problem
21. Write algorithm/C program to perform traversal in a stack
22. Write algorithm/C program to perform 1) push 2) pop 3) peek operation in a stack
23. Define queue. How it is represented in memory(array representation, linked list
representation)
24. Write algorithm/C program to perform traversal in a queue
25. Write algorithm/C program to perform 1) enqueue 2) dequeue in a queue
(Write a C program to implement queue using array)
26. Explain different types of queue.
27. Explain circular queue
28. Write algorithm/C program to perform traversal in a circular queue
29. Write algorithm/C program to perform 1) enqueue 2) dequeue in a circular queue
(Write a C program to implement queue using array)
30. Explain double ended queue (deque)
31. Explain the applications of queue

UNIT 3

2 marks questions

1. Define Tree
2. Define the following tree terminologies
i) Node
ii) Root
iii) Internal node
iv) External node
v) Edge
vi) Height of a node
vii) Depth of a node
viii) Degree of a node
ix) Height of a tree
x) Forest
xi) Path
xii) Path length
xiii) Parent
xiv) Child
xv) Sibling
xvi) Leaf
xvii) Subtree
xviii) Vising a tree
xix) Traversal of a tree
xx) Level of a node
xxi) Key of a node
xxii) Ancestor of a node
xxiii) Descendant of a node
xxiv) Predecessor of a node
xxv) Climbing and Descending
3. Define Strictly binary tree
4. Define Complete binary tree
5. Define Almost full binary tree
6. Define Skewed binary tree
7. Define Extended binary tree
8. What is a Heap tree. What are the types of heap trees
9. Define Binary Search Tree
10. What is tree traversal. What are the three types of tree traversal
11. What is an AVL tree.
12. What is balance factor. Give an example
13. Mention the types of AVL rotations
14. Define Tree sort
15. What is heap sort
16. What is external searching
17. Define Trie
18. Mention the differences between B tree and binary tree
19. Define a graph
20. Define
i) Vertex
ii) Edge
iii) Directed graph
iv) Undirected graph
v) Subgraph
vi) Adjacent vertices
vii) Incident vertices
viii) Indegree and outdegree of a vertex
ix) Degree of a vertex
x) Complete graph
xi) Connected graph
xii) Strongly connected graph
xiii) Weighted graph
xiv) Path
xv) Cycle
xvi) Loop
xvii) Directed acyclic graph
xviii) Articulation point
xix) Biconnected graph
21. Define Adjacency matrix
22. List down the graph traversal methods
23. Define topological sorting
5 marks questions

1. Explain how tree data structure is represented in memory(array representation, linked list
representation)
2. Mention the advantages and disadvantages of linked list representation of a binary tree
compared to array representation
3. Define Binary Tree. What are the properties of a binary tree
4. Write an algorithm/C program to create a binary tree
5. Write an algorithm/C program to perform in-order,post-order and pre-order traversal of a
tree
6. What is a binary search tree. What are the operations that can be performed on a binary
search tree
7. Construct a binary tree using:
Inorder : E A C K F H D B G
Postorder : E C K A H B G D F
8. Construct a binary search tree for elements 45, 15, 79, 90, 10, 55, 12, 20, 50
9. Write an algorithm/C program to create a binary search tree
10. Write the steps/algorithm to insert an element into a binary search tree
11. Write steps to insert element 65 into the binary search tree

12. Write the steps/algorithm to delete an element from a binary search tree
13. Write steps to delete element 45 from the binary search tree

14. Write the algorithm/C program to search an element in a binary search tree(tree search)
15. Write steps to Search for 20 in the binary search tree
16. What are the applications of Trees
17. What is an AVL tree. What are the operations that can be performed on an AVL tree
18. Explain AVL tree rotations
19. Write the algorithm/C program for heap sort
20. Explain heap sort for 9,16,32,8,4,1,5,8,0
21. Define graph. How graph data structure is represented in memory.
(Explain Adjacency matrix and Adjacency list)
22. Explain Breadth First Search (Algorithm and an example)
23. Explain Depth First Search (Algorithm and an example)
24. Consider the graph below. Starting at vertex 1, traverse the graph by DFS

25. Consider the graph below. Starting at vertex 1, traverse the graph by BFS

26. Define Topological sort with an example

UNIT 4

2 marks questions

1. Define searching. List down the various searching techniques


2. Define linear search. What is the complexity of linear search
3. Define binary search. What is the complexity of binary search
4. Define sorting. List down various sorting techniques
5. What is divide and conquer technique
6. Define hashing
7. Define hash table
8. Define collision
9. Define hash function

5 marks questions
1. Differentiate linear search and binary search
2. Write down an algorithm/C program to perform linear search with an example
3. Write down an algorithm/C program to perform binary search with an example
4. Write down an algorithm/C program to perform insertion sort with an example
5. Explain how to sort 25,57,48,37,12,82,86,33 using insertion sort
6. Write down an algorithm/C program to perform selection sort with an example
7. Explain how to sort 25,57,48,37,12,82,86,33 using selection sort
8. Write down an algorithm/C program to perform bubble sort with an example
9. Explain how to sort 25,57,48,37,12,82,86,33 using bubble sort
10. Write down an algorithm/C program to perform quick sort with an example
11. Explain how to sort 25,57,48,37,12,82,86,33 using quick sort
12. Write down an algorithm/C program to perform shell sort with an example
13. Explain how to sort 25,57,48,37,12,82,86,33 using shell sort
14. Write down an algorithm/C program to perform merge sort with an example
15. Explain how to sort 25,57,48,37,12,82,86,33 using merge sort
16. Explain various methods of choosing hashing function
17. What are the techniques of resolving hash function?
18. Explain linear probing with example
19. Explain quadratic probing with example
20. Explain double hashing with example
21. Explain rehashing with example
22. Explain collision resolution by chaining with an example

You might also like