This quiz works best with JavaScript enabled. Home > Class 12 > Class 12 Computer Science Chapter 1 Data Structures Using Python – Quiz 27 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 1 Data Structures Using Python Quiz 27 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Function is a A) User define data type. B) Built in data type. C) All the above. D) None of the above. Show Answer Correct Answer: A) User define data type. 2. What does the following function do for a given Linked List with first node as head?void fun1(struct node* head)\{ if(head == NULL) return; fun1(head$\rightarrow$next); printf("%d ", head$\rightarrow$data);\} A) Prints all nodes of linked lists. B) Prints all nodes of linked list in reverse order. C) Prints alternate nodes of Linked List. D) Prints alternate nodes in reverse order. Show Answer Correct Answer: B) Prints all nodes of linked list in reverse order. 3. Collection of similar type of data item is called A) Structure. B) Array. C) Recursion. D) None of the above. Show Answer Correct Answer: B) Array. 4. In AVL tree, the balance factor of a node is defined as the difference between the heights of its left and right subtrees. What is the range of the balance factor for a node in a balanced AVL tree? A) -1 to 1. B) 0 to 2. C) -2 to 2. D) 1 to 3. Show Answer Correct Answer: A) -1 to 1. 5. This characteristic describes whether the data items are arranged in chronological sequence, such as with an array, or in an unordered sequence, such as with a graph. A) Static or dynamic. B) Linear or non-linear. C) Homogeneous or non-homogeneous. D) None of the above. Show Answer Correct Answer: B) Linear or non-linear. 6. What is the name given to an abstract representation of how data is stored in a 2D array? A) Record. B) File. C) Field. D) Table. Show Answer Correct Answer: D) Table. 7. Pop() method does ..... A) Shows the first element in the list. B) Shows the last element in the list. C) Deletes the last element from the list and returns. D) Deletes the last element from the list. Show Answer Correct Answer: C) Deletes the last element from the list and returns. 8. Which of the following is not a disadvantage to the usage of array? A) Fixed size. B) There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size. C) Insertion based on position. D) Accessing elements at specified positions. Show Answer Correct Answer: D) Accessing elements at specified positions. 9. What is the output of the following code:'print((1, 2) + (3, 4))'? A) (1, 2, 3). B) (1, 2, 3, 4). C) (1, 2, 4). D) (1, 2, 3, 4, 5). Show Answer Correct Answer: B) (1, 2, 3, 4). 10. What are the key characteristics of tuples in Python? A) Tuples are immutable, ordered, allow duplicates, can contain mixed data types, and are hashable. B) Tuples are dynamic, indexed, and only allow strings. C) Tuples are mutable, unordered, and cannot contain duplicates. D) Tuples are mutable, can only contain integers, and are not hashable. Show Answer Correct Answer: A) Tuples are immutable, ordered, allow duplicates, can contain mixed data types, and are hashable. 11. How do sets differ from lists in Python? A) Sets differ from lists in that sets are unordered and contain unique elements, while lists are ordered and can contain duplicates. B) Sets can contain duplicate elements like lists. C) Sets maintain the order of elements like lists. D) Lists are unordered collections of unique items. Show Answer Correct Answer: A) Sets differ from lists in that sets are unordered and contain unique elements, while lists are ordered and can contain duplicates. 12. What are the advantages of using a binary tree over a linked list? A) A binary tree allows for faster search operations compared to a linked list. B) A binary tree uses less memory than a linked list. C) A binary tree can only store integer values, while a linked list can store any data type. D) A binary tree is a linear data structure, while a linked list is hierarchical. Show Answer Correct Answer: A) A binary tree allows for faster search operations compared to a linked list. 13. Which of following data structure is more appropriate forimplementing quick sort iteratively? A) Deque. B) Priority queue. C) Stack. D) Queue. Show Answer Correct Answer: C) Stack. 14. STACK follows A) LIFO. B) LIFS. C) FIFO. D) FFS. Show Answer Correct Answer: A) LIFO. 15. Stack uses ..... data structure as the element that was inserted last is the first one to be taken out. A) LIPO. B) FIFO. C) LIFO. D) FIPO. Show Answer Correct Answer: C) LIFO. 16. How do you create a lambda function in Python? A) A lambda function is created using the 'lambda' keyword followed by parameters and an expression. B) A lambda function is defined using the 'def' keyword. C) A lambda function is a built-in function that cannot be created by the user. D) A lambda function is created by importing the 'lambda' module. Show Answer Correct Answer: A) A lambda function is created using the 'lambda' keyword followed by parameters and an expression. 17. What happens if you try to access a key that doesn't exist in a Python dictionary?Criterion 2:Apply reasoning to solve real-world problems in various contexts A) The program crashes. B) 'KeyError' is raised. C) It returns an empty string. D) It returns 'None'. Show Answer Correct Answer: B) 'KeyError' is raised. 18. Which data structure is used for storing key-value pairs in Python? A) List. B) Set. C) Dictionary. D) Tuple. Show Answer Correct Answer: C) Dictionary. 19. Priority Queues can be implemented in Java using the PriorityQueue class from the ..... package. A) Java.scanner. B) Java.io. C) Java.linkedlist. D) Java.util. Show Answer Correct Answer: D) Java.util. 20. What does the following code snippet do? void solve(ListNode* node) \{ node = node $\rightarrow$ next;\} A) Deletes the given node form the linked list. B) Alters nothing in main function. C) Prints all nodes of linked list in reverse order. D) Prints alternate nodes of Linked List. Show Answer Correct Answer: B) Alters nothing in main function. 21. What is the number of moves required to solve Tower of Hanoi problem for k disks? A) 2k-1. B) 2k + 1. C) 2$^{k}$ + 1. D) 2$^{k}$-1. Show Answer Correct Answer: D) 2$^{k}$-1. 22. In a singly linked list, what does each node contain? A) Only the data value. B) Data and references to both previous and next nodes. C) Data and a reference to the next node. D) Data and a unique identifier. Show Answer Correct Answer: C) Data and a reference to the next node. 23. *The evaluation of the above postfix expression is A) 10. B) 41. C) 9. D) 21. Show Answer Correct Answer: D) 21. 24. How do you access the first element of a nested dictionary? A) Nested dict['inner key']['outer key']. B) Nested dict.outer key.inner key. C) Nested dict['outer key'].inner key. D) Nested dict['outer key']['inner key']. Show Answer Correct Answer: D) Nested dict['outer key']['inner key']. 25. A function calls itself is called ..... A) Queue. B) Recursion. C) Function. D) None of above. Show Answer Correct Answer: B) Recursion. ← 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