This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 24 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 24 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. List some common string methods in Python. A) Find(). B) Join(). C) ['lower()', 'upper()', 'strip()', 'replace()', 'split()']. D) Concat(). Show Answer Correct Answer: C) ['lower()', 'upper()', 'strip()', 'replace()', 'split()']. 2. A FIFO structure implemented as a ring where the front and rear pointers can wrap around the end of the start of the array. A) Linear Queue. B) Circular Queue. C) Priority Queue. D) None of the above. Show Answer Correct Answer: B) Circular Queue. 3. What are the advantages of using list comprehension? A) List comprehension is only useful for large datasets. B) It simplifies debugging and error handling. C) Advantages of using list comprehension include improved readability, reduced code length, and potentially better performance. D) List comprehension can only be used with strings. Show Answer Correct Answer: C) Advantages of using list comprehension include improved readability, reduced code length, and potentially better performance. 4. What are the worst case and average case complexities of a binary search tree? A) O(n), O(n). B) O(logn), O(logn). C) O(logn), O(n). D) O(n), O(logn). Show Answer Correct Answer: D) O(n), O(logn). 5. What does it mean when an array is described as 'static'? A) It can change size. B) It can only hold string data types. C) It moves around in memory. D) It cannot change size once set up. Show Answer Correct Answer: D) It cannot change size once set up. 6. You are given a knapsack that can carry a maximum weight of 60. There are 4 items with weights \{20, 30, 40, 70\} and values \{70, 80, 90, 200\}. What is the maximum value of the items you can carry using the knapsack? A) 170. B) 200. C) 160. D) 90. Show Answer Correct Answer: C) 160. 7. How do you analyze the time complexity of an algorithm? A) Time complexity is determined solely by the programming language used. B) Time complexity is irrelevant to algorithm performance. C) Time complexity can only be analyzed using linear equations. D) Time complexity is analyzed by identifying basic operations, assessing growth with input size, and using Big O notation. Show Answer Correct Answer: D) Time complexity is analyzed by identifying basic operations, assessing growth with input size, and using Big O notation. 8. What is a correct way to visualize a four-dimensional array? A) As a set of cubes. B) As a set of tables. C) As a set of lines. D) As a single point. Show Answer Correct Answer: A) As a set of cubes. 9. Which of the following can be done with LinkedList? A) Implementation of Stacks and Queues. B) Implementation of Binary Trees. C) Implementation of Abstract Data Structures with dynamic memory allocation. D) All of the above. Show Answer Correct Answer: D) All of the above. 10. Which type of traversal of binary search tree outputs the value in sorted order? A) Pre-order. B) Post-order. C) In-Order. D) None. Show Answer Correct Answer: C) In-Order. 11. Which method would you use to retrieve a value from a dictionary using a key? A) Use parentheses to access the value. B) Use square bracket notation or the get() method. C) Use the index method to retrieve the value. D) Call the dictionary with the key as an argument. Show Answer Correct Answer: B) Use square bracket notation or the get() method. 12. Consider the following pseudocode that uses a stackdeclare a stack of characterswhile ( there are more characters in the word to read )\{ \{ read a character push the character on the stack\}while ( the stack is not empty )\{ pop a character off the stack write the character to the screen\}What is output for input "computer" ? A) Computer. B) Computercomputer. C) Retupmocretupmoc. D) Retupmoc. Show Answer Correct Answer: D) Retupmoc. 13. What are tuples and how are they different from lists? A) Tuples are mutable unordered collections, while lists are immutable ordered collections. B) Tuples are immutable ordered collections, while lists are mutable ordered collections. C) Tuples are unordered collections, whereas lists are ordered collections. D) Tuples are ordered collections that can be changed, while lists cannot. Show Answer Correct Answer: B) Tuples are immutable ordered collections, while lists are mutable ordered collections. 14. ..... is a collection of elements used to store the same type of data. A) Array. B) Switch. C) Case. D) Loop. Show Answer Correct Answer: A) Array. 15. List two operations that can be performed on data structures. A) Filtering, Grouping. B) Searching, Merging. C) Traversal, Sorting. D) Insertion, Deletion. Show Answer Correct Answer: D) Insertion, Deletion. 16. In a min-heap: A) Parent nodes have values greater than or equal to their Childs. B) Parent nodes have values less than or equal to their Childs. C) Both statements are true. D) Both statements are wrong. Show Answer Correct Answer: A) Parent nodes have values greater than or equal to their Childs. 17. What is the range of floating point number in C? A) 1.7 e-38 to 1.7 e +38. B) 3.4 e-38 to 3.4 e +38. C) 1.7 e-308 to 1.7 e +308. D) 3.4 e-308 to 3.4 e +308. Show Answer Correct Answer: B) 3.4 e-38 to 3.4 e +38. 18. In a full binary tree if number of internal nodes is I, then number of leaves L are? A) L = 2*I. B) L = I + 1. C) L = I-1. D) L = 2*I-1. Show Answer Correct Answer: B) L = I + 1. 19. A Data Structure is: A) A C++ vector. B) A way of organizing, storing and performing operations on data. C) A function in any programming language. D) A sequence of steps to solve a problem. Show Answer Correct Answer: B) A way of organizing, storing and performing operations on data. 20. Elements can be removed from a stack from A) Top. B) Bottom. C) Anywhere like array. D) None of the above. Show Answer Correct Answer: A) Top. 21. The two major factors of data structure complexity are: A) Time and location. B) Type and size. C) Time and memory. D) Type and space. Show Answer Correct Answer: C) Time and memory. 22. Binart search requires sorted aaray A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes. 23. Int nums[ ] = \{2, 3, 5, 8, 9, 11\};How would you access the fourth element in nums A) Nums[8]. B) Nums[3]. C) Nums(4). D) Nums(3). Show Answer Correct Answer: B) Nums[3]. 24. Consider the following numbers 8, 1, 2, 4, 3, 9, 6, 5 to be inserted into the empty binary search tree. What will be the sequence of in-order traversal of the resultant binary search tree? A) 8 1 3 5 6 9 2 4. B) 1 2 3 4 5 6 8 9. C) 5 6 9 3 4 2 1 8. D) 8 1 2 4 3 9 6 5. Show Answer Correct Answer: B) 1 2 3 4 5 6 8 9. 25. Data structure= Organized data + ..... A) Allowed operations on it. B) Allowed functions on it. C) None of the above. D) None of the above. Show Answer Correct Answer: A) Allowed operations on it. ← PreviousNext →Related QuizzesClass 12 Computer Science Chapter 1 Data Structures Using Python Quiz 1Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 2Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 3Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 4Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 5Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 6Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 7Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 8Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 9Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books