1. What is a data structure?
(A) A loop
(B) A type of function
(C) A way to store and organize data efficiently
(D) A variable
2. What is an algorithm?
(A) A loop structure
(B) A type of variable
(C) A function
(D) A step-by-step procedure to solve a problem
3. Which of the following is an example of a linear data structure?
(A) Tree
(B) Array
(C) Graph
(D) Hash table
4. Which of the following is a non-linear data structure?
(A) Stack
(B) List
(C) Tree
(D) Queue
5. What is the main goal of using data structures?
(A) Faster loops
(B) Efficient storage, retrieval, and modification of data
(C) Allocating memory
(D) Handling exceptions
6. What is a stack?
(A) A linear data structure that follows last-in, first-out (LIFO) order
(B) A type of queue
(C) A non-linear data structure
(D) A memory location
7. What is a queue?
(A) A linear data structure that follows first-in, first-out (FIFO) order
(B) A stack
(C) A tree
(D) A graph
8. Which of the following is true about arrays?
(A) They store elements at contiguous memory locations
(B) They store elements randomly
(C) They are always non-linear
(D) They cannot store multiple values
9. Which data structure is ideal for implementing recursion?
(A) Stack
(B) Queue
(C) Array
(D) Tree
10. Which of the following is a dynamic data structure?
(A) Array
(B) Linked list
(C) Stack
(D) Queue
11. What is a linked list?
(A) A stack
(B) An array
(C) A collection of nodes where each node points to the next
(D) A queue
12. Which of the following is a type of searching algorithm?
(A) Linear search
(B) Binary search
(C) Both A and B
(D) None of the above
13. Which searching algorithm is faster for sorted data?
(A) Linear search
(B) Binary search
(C) Both are same
(D) None of the above
14. Which of the following is a sorting algorithm?
(A) Bubble sort
(B) Merge sort
(C) All of the above
(D) Quick sort
15. What is time complexity?
(A) Memory used by variables
(B) A measure of how the running time of an algorithm grows with input size
(C) Size of loops
(D) Number of functions
16. What is space complexity?
(A) A measure of the memory used by an algorithm
(B) Number of loops
(C) Length of variables
(D) Number of functions
17. Which of the following is used to represent hierarchical data?
(A) Queue
(B) Tree
(C) Stack
(D) Array
18. Which of the following is used to represent relationships between objects?
(A) Array
(B) Graph
(C) Stack
(D) Queue
19. Which algorithm technique divides a problem into smaller subproblems and solves them recursively?
(A) Dynamic programming
(B) Greedy
(C) Divide and conquer
(D) Brute force
20. What is the main goal of algorithms and data structures?
(A) To store variables
(B) To create loops
(C) To solve problems efficiently in terms of time and memory
(D) To handle exceptions