This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 29 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 29 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following is an advantage of using functions in Python?Criterion 1:Evaluate and select information sources based on their appropriateness to specific tasks A) They make code longer. B) They allow you to reuse code efficiently. C) They make the code harder to debug. D) They increase the risk of errors in the program. Show Answer Correct Answer: B) They allow you to reuse code efficiently. 2. How do you create a set in Python? A) You can create a set in Python using set() or by using curly braces, e.g., set() or \{1, 2, 3\}. B) Defining a dictionary with curly braces, e.g., \{key:value\}. C) Using square brackets, e.g., [1, 2, 3]. D) Creating a list with list() function. Show Answer Correct Answer: A) You can create a set in Python using set() or by using curly braces, e.g., set() or \{1, 2, 3\}. 3. What is an array in data structure theory? A) A data structure that stores multiple items of the same type. B) A data structure that stores multiple items of different data types. C) A data structure that only stores numeric data types. D) A data structure only used in Python. Show Answer Correct Answer: A) A data structure that stores multiple items of the same type. 4. What are the 3 depth traversals for a tree data structure? A) Pre-, In-and Post-order. B) Pro-, In-and Past-order. C) Pre-, Out-and Post-order. D) Pre-, In-and New-order. Show Answer Correct Answer: A) Pre-, In-and Post-order. 5. Which operator is used for checking if two values are equal in Python? A) ==. B) =. C) !=. D) Is. Show Answer Correct Answer: A) ==. 6. Describe how to traverse a binary tree in order. A) In-order traversal visits nodes in the order:left subtree, root, right subtree. B) Post-order traversal visits nodes in the order:right subtree, root, left subtree. C) Level-order traversal visits nodes in the order:top to bottom, left to right. D) Pre-order traversal visits nodes in the order:root, left subtree, right subtree. Show Answer Correct Answer: A) In-order traversal visits nodes in the order:left subtree, root, right subtree. 7. ..... is a data structure in which every individual node consists of INFO to store data and LINK to store the address of the next node. A) Queue. B) Stack. C) Singly Linked List. D) Circular queue. Show Answer Correct Answer: C) Singly Linked List. 8. The algorithms like merge sort, quick sort and binary search are based on A) Greedy algorithm. B) Divide and Conquer algorithm. C) Hash table. D) Parsing. Show Answer Correct Answer: B) Divide and Conquer algorithm. 9. Go to statement is the part of ..... A) Conditional statement. B) Unconditional statement. C) None of the above. D) None of the above. Show Answer Correct Answer: A) Conditional statement. 10. Given an empty AVL tree, how would you construct AVL tree when a set of numbers are given without performing any rotations? A) Just build the tree with the given input. B) Find the median of the set of elements given, make it as root and construct the tree. C) Use trial and error. D) Use dynamic programming to build the tree. Show Answer Correct Answer: B) Find the median of the set of elements given, make it as root and construct the tree. 11. Can I add any data type to a tuple A) Yes, they are the same as a python list, however immutable after creation. B) No, all of the elements in the tuple have to be the same datatype. C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes, they are the same as a python list, however immutable after creation. 12. An array elements are always stored in ..... memory locations. A) Sequential. B) Random. C) Sequential and Random. D) None of the above. Show Answer Correct Answer: A) Sequential. 13. Python has true 2-dimensional arrays?True or False? A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 14. In a max-heap, element with the greatest key is always in the which node? A) Leaf node. B) First node of left sub tree. C) Root node. D) First node of right sub tree. Show Answer Correct Answer: C) Root node. 15. How do you iterate over a dictionary in Python? A) For key in my dict.keys():# iterates over keys only. B) For item in my dict:# iterates over items. C) For entry in my dict.items():# iterates over entries. D) For key in my dict:# iterates over keysfor value in my dict.values():# iterates over valuesfor key, value in my dict.items():# iterates over key-value pairs. Show Answer Correct Answer: D) For key in my dict:# iterates over keysfor value in my dict.values():# iterates over valuesfor key, value in my dict.items():# iterates over key-value pairs. 16. Under which data structure category does the Stack fall? A) Homogeneous. B) Built-in. C) Non linear. D) Linear. Show Answer Correct Answer: D) Linear. 17. How do you create a dictionary? A) Use curly braces with key-value pairs, e.g., \{'key':'value'\}. B) Use square brackets with key-value pairs, e.g., ['key':'value']. C) Create a dictionary using parentheses, e.g., ('key', 'value'). D) Define a dictionary with a colon, e.g., 'key':'value'. Show Answer Correct Answer: A) Use curly braces with key-value pairs, e.g., \{'key':'value'\}. 18. What is a list in Python and how is it different from a tuple? A) Both lists and tuples are mutable and can be changed. B) A list is immutable and cannot be changed, while a tuple is mutable and can be changed. C) A list is mutable and can be changed, while a tuple is immutable and cannot be changed. D) A list can only contain integers, while a tuple can contain any data type. Show Answer Correct Answer: C) A list is mutable and can be changed, while a tuple is immutable and cannot be changed. 19. Which is an entity? A) Student. B) Name. C) Roll. D) Age. Show Answer Correct Answer: A) Student. 20. Queue follows ..... order A) FIFO (First In First Out ). B) LIFO (Last In First Out). C) Random. D) FILO(First In Last Out). Show Answer Correct Answer: A) FIFO (First In First Out ). 21. Quick sort follows Divide-and-Conquer strategy. A) A) True. B) B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) A) True. 22. What is the best data structure for implementing a priority queue? A) Heap. B) Queue. C) Stack. D) Linked list. Show Answer Correct Answer: A) Heap. 23. Which of the following algorithms is not feasible to implement in a linked list? A) Insertion Sort. B) Quick Sort. C) Heap Sort. D) Binary Search. Show Answer Correct Answer: D) Binary Search. 24. (A):Items of stack are inserted at top end.(B):Items of queue are inserted from front end. A) Both A and B are true. B) Only A is true. C) Only B is true. D) Both A and B are false. Show Answer Correct Answer: B) Only A is true. 25. What is the syntax for creating a set in Python? A) \{value1, value2, \}. B) [value1, value2, ]. C) (value1, value2, ). D) \{key:value\}. Show Answer Correct Answer: A) \{value1, value2, \}. ← 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