This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 5 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 5 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is the purpose of the len() function in Python? A) Adds items to a List or Dictionary. B) Deletes items from a List or Dictionary. C) Returns the number of items in a List, Tuple, or Dictionary. D) Sorts the items in a List or Dictionary. Show Answer Correct Answer: C) Returns the number of items in a List, Tuple, or Dictionary. 2. In single linked list, the pointer of last node contains A) Null. B) Address of first node. C) Only data value. D) Only address. Show Answer Correct Answer: A) Null. 3. When a pop() operation is called on an empty queue, what is the condition called? A) Overflow. B) Underflow. C) Syntax error. D) Garbage value. Show Answer Correct Answer: B) Underflow. 4. In ..... data structures all elements may or may not be of same type. A) Linear. B) Non linear. C) Homogeneous. D) Non-homogeneous. Show Answer Correct Answer: D) Non-homogeneous. 5. What is the primary advantage of using a linked list over an array? A) Faster access to elements by index. B) Dynamic memory allocation allowing efficient insertions and deletions. C) Requires less memory for storage. D) Simplified sorting algorithms. Show Answer Correct Answer: B) Dynamic memory allocation allowing efficient insertions and deletions. 6. How can you use string comprehension in Python? A) String comprehension is done with the format 'str(item) for item in iterable'. B) You can create strings using the syntax '[]' for item in iterable. C) Use string comprehension by applying 'map()' on the iterable directly. D) You can use string comprehension in Python by using the syntax ''.join(expression for item in iterable if condition). Show Answer Correct Answer: D) You can use string comprehension in Python by using the syntax ''.join(expression for item in iterable if condition). 7. Which data structure in Python is best suited for implementing a queue? A) List. B) Dictionary. C) Set. D) Deque. Show Answer Correct Answer: D) Deque. 8. What is a full binary tree? A) A binary tree where each node has either 0 or 2 children. B) A binary tree where each node has exactly two children. C) A binary tree where every node has exactly one child. D) A binary tree with exactly one node. Show Answer Correct Answer: B) A binary tree where each node has exactly two children. 9. Which of the following abstract data types can be used to represent a many to-many relation? A) Op 1:Tree. B) Op 2:Stack. C) Op 3:Graph. D) Op 4:Queue. Show Answer Correct Answer: C) Op 3:Graph. 10. What is the function peak means? A) Showing all elements in a stack. B) Showing the last index value. C) Deleting the last index value. D) Showing zeroth index value. Show Answer Correct Answer: C) Deleting the last index value. 11. In Python, which data structure can be implemented using a list with append and pop operations? A) Dictionary. B) Stack. C) Queue. D) Set. Show Answer Correct Answer: B) Stack. 12. In Python, which data structure is used to store an ordered collection of individual items? A) List. B) Set. C) Dictionary. D) Tuple. Show Answer Correct Answer: A) List. 13. Data structure provide a means to manage huge amount of data ..... A) Inefficiently. B) Efficiently. C) With complexity. D) With problems. Show Answer Correct Answer: B) Efficiently. 14. If I add 2 elements that are the same to a python set what will happen? A) Python sets are all unique, so it will only be put in once. B) There will be 2 of the same elements within the set. C) All the above. D) None of the above. Show Answer Correct Answer: A) Python sets are all unique, so it will only be put in once. 15. In Binary trees nodes with no successor are called ..... A) Final nodes. B) Last nodes. C) Terminal nodes. D) End nodes. Show Answer Correct Answer: C) Terminal nodes. 16. Efficiency of an algorithm is measured by A) Time and Capacity complexity. B) Time and Space complexity. C) Speed and Space complexity. D) Speed and Capacity complexity. Show Answer Correct Answer: B) Time and Space complexity. 17. Which of the following is non-liner data structure? A) Stack. B) List. C) Graph. D) Array. Show Answer Correct Answer: C) Graph. 18. A field or collection of fields in a record which identifies a record uniquely is called a ..... A) Primary Key. B) Secondary Key. C) None of the above. D) None of the above. Show Answer Correct Answer: A) Primary Key. 19. In one dimensional array if LB = 0 and UB = 10 then the array size is ..... A) 12. B) -1. C) 9. D) 11. Show Answer Correct Answer: D) 11. 20. In a stack, if a user tries to remove an element from empty stack it is called ..... A) Underflow. B) Empty collection. C) Overflow. D) Garbage Collection. Show Answer Correct Answer: A) Underflow. 21. 4 trees are B-trees of order 4. They are an isometric of ..... trees. A) AVL. B) AA. C) 2-3. D) Red-Black. Show Answer Correct Answer: D) Red-Black. 22. What is the purpose of keys in a dictionary? A) To store data in a linear format. B) The purpose of keys in a dictionary is to uniquely identify and access values. C) To sort values alphabetically. D) To create a list of values. Show Answer Correct Answer: B) The purpose of keys in a dictionary is to uniquely identify and access values. 23. Types of data structures are ..... A) Primitive and non-primitive. B) Linear and non-linear. C) Static and dynamic. D) All above. Show Answer Correct Answer: D) All above. 24. Which one of the following is an application of Stack Data Structure? A) Managing function calls. B) The stock span problem. C) Arithmetic expression evaluation. D) All the above. Show Answer Correct Answer: D) All the above. 25. Explain the use of the 'finally' block in exception handling. A) The 'finally' block is only executed if an exception occurs. B) The 'finally' block guarantees execution of code after try and except blocks, regardless of exceptions. C) The 'finally' block can be skipped if the code is running in a loop. D) The 'finally' block is used to define a new exception type. Show Answer Correct Answer: B) The 'finally' block guarantees execution of code after try and except blocks, regardless of exceptions. ← 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 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 10Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books