Jhbdjhbsdjhsbfndsfnds
DEPARTMENT OF CYBER SECURITY
Subject Code&Title:24CB13001-DATA STRUCTURES AND ALGORITHMS
UNIT-1
PART 1(ONE MARKS)
1.What is a Data Structure?
a) A way to store and organize data efficiently
b) A programming language
c) A type of algorithm
d) A method to convert data into binary
2.Which of the following is a Linear Data Structure?
a) Tree
b) Graph
c) Stack
d) Hash Table
3.What is the main characteristic of a Static Data Structure?
a) Size cannot change at runtime
b) Uses pointers for memory allocation
c) Elements are stored in a linked format
d) It is always more efficient than dynamic structure
4.Which of the following is an example of a Non-Primitive Data Structure?
a) Integer
b) Character
c) Array
d) Float
5.What does LIFO stand for in Stack Data Structure?
a) Last In First Out
b) Last In Fast Out
c) Low Input First Output
d) Large In First Out
6. Which of the following data structures follows FIFO (First In First Out) order?
a) Stack
b) Queue
c) Tree
d) Graph
7. In which data structure do elements have hierarchical relationships?
a) Array
b) Tree
c) Stack
d) Queue
8. A linked list is an example of:
a) Static Data Structure
b) Primitive Data Structure
c) Dynamic Data Structure
d) Hierarchical Data Structure
9. What type of data structure is used for implementing recursion?
a) Queue
b) Stack
c) Array
d) Graph
10. What is a key advantage of a dynamic data structure?
a) Fixed memory size
b) Efficient searching
c) Can grow or shrink during execution
d) Uses less memory
11. Which of the following is an Abstract Data Type?
a) Stack
b) Array
c) Boolean
d) Integer
12. What operation is not associated with a Queue ADT?
a) Enqueue
b) Dequeue
c) Peek
d) Pop
13. What is the primary characteristic of ADT?
a) Defines implementation details
b) Specifies only operations and behavior
c) Requires specific programming language
d) Must be implemented using arrays
14. Which of the following ADTs allows insertion at one end and deletion at another?
a) Stack
b) Queue
c) Tree
d) Graph
15. Which ADT uses both Enqueue and Dequeue operations?
a) Stack
b) Tree
c) Queue
d) Graph
16. Which notation represents the worst-case time complexity of an algorithm?
a) Θ (Theta)
b) Ω (Omega)
c) O (Big O)
d) o (Little o)
17. What is the time complexity of binary search?
a) O(n)
b) O(log n)
c) O(n^2)
d) O(1)
18. Which sorting algorithm is based on the Divide and Conquer technique?
a) Bubble Sort
b) Selection Sort
c) Merge Sort
d) Insertion Sort
19. What is the main difference between Divide & Conquer and Dynamic Programming?
a) Dynamic programming avoids recomputation of subproblems
b) Divide & Conquer solves all subproblems independently
c) Both have the same approach
d) None of the above
20. Which of the following is an example of a Backtracking algorithm?
a) Quick Sort
b) Merge Sort
c) N-Queens Problem
d) Bubble Sort
21. Which operation is used to visit each element of a data structure?
a) Sorting
b) Searching
c) Traversal
d) Merging
22. Which data structure is most suitable for implementing recursion?
a) Stack
b) Queue
c) Linked List
d) Array
23. What is the purpose of a sorting algorithm?
a) To search for an element
b) To delete an element
c) To arrange elements in order
d) To traverse a data structure
24. Which of the following operations is used to add an element to a data structure?
a) Delete
b) Insert
c) Search
d) Sort
25. What is the worst-case time complexity of linear search?
a) O(1)
b) O(log n)
c) O(n)
d) O(n²)
PART-B(2 MARKS)
1. Define Data Structure.
2. What is a Stack?
3. What are the types of Data Structures?
4. What is the difference between a Stack and a Queue?
5. Explain the term "Recursion."
6. Define Time Complexity.
7. What is Big O notation?
8. What is an Abstract Data Type (ADT)?
9. What is meant by Dynamic Programming?
10. What is a Graph?
11. What is the difference between Linear and Non-linear Data Structures?
12. What is the concept of "Divide and Conquer"?
13. What is the difference between Stack and Queue in terms of operations?
14. Define Space Complexity.
15. What is a Binary Search Tree (BST)?
PART-C(10 MARKS)
1.Divide and conquer with an example
2.Backtracking with an example
3.Explaination about Abstract Data Type
4.Dynamic Programming